1

I am trying to check if flash video is minimized or maximized. Tried to do something like this:

var video = Program.Driver.FindElement(By.XPath("//object[contains(@id, 'player_api')]"));

int videoSize = video.Size.Width;

if (videoSize > 1024)
{
     //Do something...
}

But I am getting fixed size of HTML element. Any suggestion?

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
threesixnine
  • 1,733
  • 7
  • 30
  • 56

1 Answers1

1

As far as I can see you can locate the following element:

var video = Program.Driver.FindElement(By.XPath("//*[@id='player_api']/param[6]"));

Then get its value and then find the video sizes in the flash object. You can even deserialize the value to C# object from the JSON. Check the image: http://screencast.com/t/sYu3DYxo6V

Anton Angelov
  • 1,705
  • 13
  • 16
  • Thank you, what is going to happen with the parameters when window is maximized? Are they going to change or they are static ? – threesixnine Aug 05 '15 at 11:19
  • You should try but I assume that they should be different. :) – Anton Angelov Aug 05 '15 at 11:21
  • Is there any possibility to get that maximize button inside of the flash player as an element ? – threesixnine Aug 05 '15 at 11:23
  • I don't think that WebDriver support it natively. However, you can try to automate it with Sikuli- sikuli.org/ + you can check the following article- http://www.toolsqa.com/selenium-webdriver/testing-flash-selenium-flash-javascript-communication/ – Anton Angelov Aug 05 '15 at 11:25
  • Thank you for your help. – threesixnine Aug 05 '15 at 11:26
  • you can find even more detailed information about WebDriver-flash support in the following thread- http://stackoverflow.com/questions/21241074/how-best-should-i-interact-with-flash-from-selenium-java-webdriver However, it is the same thing that I have already told you. Good luck! – Anton Angelov Aug 05 '15 at 11:28