I am gettnig the exception: "Failed to start new browser session: error while launching browser"
when trying to run a test suite with 开发者_如何学运维IE7.
Info:
- python binding
- using cygwin
I tried doing "*custom path_to_browser" and even printed out the path to browser directory in selenium module's do_command() function using os.listdir, and can see the iexplore.exe file. So I know the path is right.
I also tried setting localhost:4444 in IE7 and that didn't work either. Any ideas?
Use the new IWebDriver from Selenium v2 instead of Selenium RC. It will find your browser executables automatically (and now there's no need to start the Java Selenium RC instance anymore!)
This'll get you off the ground...
I'm using MINGW BASH on Windows XP SP3
(sorry, I can't get Markdown to render this as code, I've indented 4, then 8, phfhttt...)
#!/c/Python27/python
from selenium import webdriver
driver = webdriver.Ie()
driver.get("http://seleniumhq.org")
all_elements = driver.find_elements_by_xpath("//*") # pretty slow in IE
for index, element in enumerate(all_elements):
print "%03d element tag_name == %s" % (index, element.tag_name)
精彩评论