开发者

How can I make Internet Explorer run faster with Selenium?

I'm facing a problem with Internet Explorer while automating scripts with selenium. It is so slow that my scrip开发者_如何学Gots time out.

I am using a CSS locator for automation. Can anyone tell me how can we increase the speed of Selenium automated tests?


Try with IE webdriver it will not support css3 but still faster. If you want to write test using standard selelenium api then use webdriverbacked selenium or try using ISFW with browser string as iexplorerDriver or iexplorerRemoteDriver. We also face speed issue in case of IE and we utilized webdriver support provided by ISFW.


Timeouts finding elements is very rare!

It may be that the machine that you are running your tests on is being starved of resources. CSS selectors use javascript, from Sizzle, to find objects.

Try check that it has more resources, like CPU and RAM, and then see if that helps.


As i discussed in comment to your question, here are steps that i took after downloading the zip

  1. extracted to one dir say project-home
  2. Downloaded selenium-standalone-server jar and placed under project-home/server
  3. I found some sample tests under project-home/src dir so executed batch file project-home/scripts/seleniumTestRunner.bat to get the demo.

I found tests run in Firefox as the selenium.defaultBrowser=*firefox in project-home/resources/application.properties file. I had then tried by changing values with different browser string and found working fine.

For IE use *iehta or *iexplore

selenium.defaultBrowser=*iehta

For IE webdriver use

selenium.defaultBrowser=iexplorerDriver

For IE remote webdriver use

selenium.defaultBrowser=iexplorerRemoteDriver

I also wrote one additional test by taking ref from sample code and worked fine.

Usage for IDE plug-in

  1. install xpi
  2. record new test
  3. Exported test : file-> Export TestCase As -> InfostretchFW Format
  4. provide filename with .java extention
  5. Save under project-home\src\com\sample\automation\tests

There are some useful functionality added by IDE plug-in. Following are additional commands provided by it

  1. DefineModule

  2. EndModule

  3. IF, EndIF

  4. else, elseIf

  5. While, EndWhile

    Hope this information will help you. I got all above help from InfoStretch support center some time back! :)

Thanks.


If you use Selenium RC, you can migrate to WebDriver (Selenium 2). WebDriver (Selenium 2) is faster than Selenium RC. id is better to find out element. It is good as you are using CSS Locator, because using css locator is faster than xpath. So in this point you are in right track.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜