Tuesday 15 March 2011

python - Starting a browser in selenium -


I want to run a test with selenium. IE gives "modular error" after bringing IE 8 with this lesson "This is the initial start page for web server server":

  selenium import webdriver import time browser = webdriver.Ie () # Get the local session of IE browser.get ("http://www.google.com") # Load page time Sleep (5) browser.close ()   

So I tried Chrome. Selenium import web device browser = webdriver.Chrome () browser.get ("http://www.google.com") time.sleep (5) browser.close ()

and not the correct path for the chrome.exe application, Selenium errors Chrome has been installed as expected ... C: \ Users \ USERNAME% AppData \ Local \ Google \ Chrome Application \ chrome.exe

Here a little help would be appreciated.

Did you download?

To set up, first download the appropriate prebilt server, make sure that the server can be located on your path or the webdriver.chrome.driver system can specify its location through the property.

Then when you run

  selenium import web device browser = webdriver.Chrome () browser.get ("http://www.google.com") from time to time. Sleep (5) browser.close ()   

It should work.

No comments:

Post a Comment