加速Selenium Webdriver [英] Speeding up Selenium Webdriver

查看:228
本文介绍了加速Selenium Webdriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Firefox 20的Perl语言绑定下使用Selenium Webdriver(2.0).它的运行速度非常慢.例如,一种常见的操作是使用ID和密码填写几个<input type="text">字段.我可以用Selenium的'send_keys'方法快2到3倍来输入它.定位元素,例如在大桌子上带有特定文本的表格单元,就像看着油漆变干一样.

I am using Selenium Webdriver (2.0) under the Perl language bindings, with Firefox 20. It is incredibly slow. For example, one common operation is to fill in a couple of <input type="text"> fields with an ID and password. I could type it in 2 to 3 times faster than Selenium does a 'send_keys' method. Locating elements, such as a table cell with specific text in a large table, is like watching paint dry.

我认为也许有某种默认速度设置不是最高值,但是get_speed和set_speed方法已被删除.那么,Selenium是否已经用完了,或者我可以调整一些设置吗?我已经看到了许多有关如何减慢硒的问题,但是目前我正在寻找如何加快硒的速度.如有必要,我会担心放慢速度.

I thought that maybe there is some sort of default speed setting that wasn't at its highest value, but the get_speed and set_speed methods have been removed. So, is Selenium already running flat out, or is there some setting I can tweak? I've seen many questions about how to slow down Selenium, but at this time I'm looking for how to speed it up. I'll worry about slowing it down later, if necessary.

  • Perl:Strawberry Perl 5.16.3(测试程序驱动程序)
  • Java:1.7.0_21-b11(用于Selenium Server .jar文件)(32位)
  • Selenium :: Remote :: Driver:0.16通过CPAN(Perl语言绑定)
  • Selenium-Server-Standalone:2.32.0
  • 操作系统:Windows 7 Professional,SP 1(64位)
  • 硬件:Dell Precision T1650(至强3.5GHz 16GB RAM)
  • 浏览器:Firefox 20.0.1和Selenium IDE 1.10.0(生产用户将使用Chrome,IE9,Opera)

由于即使是原子"操作(例如在输入字段中输入文本)也是如此缓慢,因此我认为使用XPath定位符而不是CSS或Perl而不是其他某种语言并不是问题.有人建议我尝试使用Chrome而不是FF-它对有很大帮助吗?我在表格单元格中做了很多查找文本的操作,因此不幸的是CSS定位器的价值有限.

Since even an "atomic" operation such as entering text into an input field is so slow, I don't think it's an issue with using XPath locators rather than CSS, or Perl instead of some other language. It's been suggested that I try Chrome instead of FF -- can it help that much? I do a lot of locating text within table cells, so CSS locators are unfortunately of limited value.

非常感谢您的帮助!如果这种测试自动化的速度不及手动运行测试的速度,那我看起来真的很糟糕!

Thanks much for any help on this! I'm going to look real bad if this test automation isn't faster than manually running the tests!

推荐答案

聚会晚了一点,但是有一个幽灵驱动程序 http ://phantomjs.org/,它不使用屏幕驱动程序,可以挂接到硒中.

A bit late to the party but there is the phantom driver http://phantomjs.org/ which doesn't use a screen driver and can be hooked into selenium.

  ./phantomjs --webdriver=5556 --webdriver-selenium-grid-hub=http://localhost:4444

或将其链接到远程集线器

Or link it to a remote hub

这篇关于加速Selenium Webdriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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