0

I want to check if Internet Explorer window is in fullscreen mode or not?

I use driver.Manage().Window.Maximize();

It maximizes window only but does not switched to FullScreen view.

Is there any method?

olyv
  • 3,699
  • 5
  • 37
  • 67
  • What do you mean by Full Screen, is it what you get after pressing 'F 11'.? – Sham Aug 22 '14 at 06:31
  • yes that is exactly what i want – Syed Ali Mesam Aug 22 '14 at 06:58
  • How about [using JavaScript to dected whether in fullscreen mode](http://stackoverflow.com/questions/16755129/detect-fullscreen-mode) and [calling this JavaScript method from your Selenium code](http://www.mkyong.com/selenium/how-to-execute-javascript-in-selenium-webdriver/)? – Uwe Keim Aug 22 '14 at 07:34
  • 1
    @UweKeim: sounds like a good Idea !!! thanks alot – Syed Ali Mesam Aug 22 '14 at 12:51

2 Answers2

2

Selenium web driver do not have the API to achieve the Full screen as per your post. But you can achieve it through send keys method of windows. Try below code.

System.Windows.Forms.SendKeys.SendWait("{F11}");
Sham
  • 830
  • 9
  • 27
  • 1
    What if InternetExplorer opens in FullScreen? then this command will do the reverse. – Syed Ali Mesam Aug 22 '14 at 07:26
  • That needs to be decided by you, to where to put that code. Also, there is an option `InternetExplorerOptions` of passing to IE constructor. – Sham Aug 22 '14 at 10:32
0

@Sham: that is a unique way to do it... I would recommend this:

driver.Manage().Window().Maximize(); after window braces should be added
Community
  • 1
  • 1
J-Roel
  • 520
  • 1
  • 4
  • 21