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
- extracted to one dir say
project-home
- Downloaded selenium-standalone-server jar and placed under
project-home/server
- I found some sample tests under
project-home/src
dir so executed batch fileproject-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
- install xpi
- record new test
- Exported test : file-> Export TestCase As -> InfostretchFW Format
- provide filename with .java extention
- 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
DefineModule
EndModule
IF, EndIF
else, elseIf
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.
精彩评论