如何在启动 Selenium Remote Control 期间调整 Firefox 窗口的大小/最大化? [英] How to resize/maximize Firefox window during launching Selenium Remote Control?

查看:17
本文介绍了如何在启动 Selenium Remote Control 期间调整 Firefox 窗口的大小/最大化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Selenium 遥控器.在执行测试期间,实际的 Firefox 窗口非常小.我想要它全屏,所以我可以看到发生了什么.如何最大化浏览器屏幕?

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 maximize the browser screen?

推荐答案

试试windowMaximize命令:

Try the windowMaximize command:

selenium.windowMaximize();

您还可以使用以下命令设置特定的宽度和高度:

You can also set a specific width and height using the following command:

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

X 是宽度,Y 是高度.

Where X is the width and Y is the height.

这篇关于如何在启动 Selenium Remote Control 期间调整 Firefox 窗口的大小/最大化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆