How to resize/maximize Firefox window during launching Selenium Remote Control?

后端 未结 9 1313
眼角桃花
眼角桃花 2020-12-14 07:47

I am using Selenium Remote Control . During executing the tests the actual Firefox window is so small. I want it full screen so I can see what is happening. How can I maximi

9条回答
  •  孤街浪徒
    2020-12-14 08:22

    To expand on David Hunt's suggestion for more specific window resizing and moving note the following.

    To work in most environments move before resizing. That is:

    selenium.getEval("window.moveTo(X, Y); window.resizeTo(X, Y); ")

    To cover 2/3's of the screen, which is handy for seeing part of the selenium driving window underneath, and to do this regardless of your target screen resolution:

    selenium.getEval("window.moveTo(screen.availWidth / 3,0); window.resizeTo(screen.availWidth * (2/3), screen.availHeight); ");

提交回复
热议问题