如何使用slimerjs在casperjs中运行测试脚本时如何最大化浏览器窗口 [英] How can I maximize the browser window while running test scripts in casperjs using slimerjs

查看:95
本文介绍了如何使用slimerjs在casperjs中运行测试脚本时如何最大化浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用slimerjs引擎在casperjs中运行测试脚本时,我无法查看整个窗口。谁能帮助我增加mozila浏览器窗口大小

I'm unable to view the full window while running test scripts in casperjs using slimerjs engine . could any one please help me to increase the mozila browser window size

推荐答案

当然,在casper中使用phantom / slimer viewportSize选项:

Sure, use the phantom/slimer viewportSize option in casper :

casper.options.viewportSize = {width: 1600, height: 950};

或者使用casper函数:

Or the casper function :

casper.start(url)
.viewport(1600,1000)
.{...}

使用此功能,您可以在场景的步骤中轻松更改窗口大小。

With the function you can easily change the window size during steps of a scenario.

和scrollTo() ,srollToBottom()函数也应为您提供帮助: http://casperjs.readthedocs.org/en/ Latest / modules / casper.html#scrollto

And the scrollTo(), srollToBottom() functions should help you too : http://casperjs.readthedocs.org/en/latest/modules/casper.html#scrollto

这篇关于如何使用slimerjs在casperjs中运行测试脚本时如何最大化浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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