Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
591 views
in Technique[技术] by (71.8m points)

eclipse - How to use different version of IE (IE6, 7, 8, 9 and 10) in Selenium WebDriver with Java

I have downloaded "IEDriverServer_Win32_2.28.0.zip" from the following URL: http://code.google.com/p/selenium/downloads/detail?name=IEDriverServer_Win32_2.28.0.zip&can=2&q=

After extracting zip file in a folder, I have used that path in my WebDriver Java code as below:

File file = new File("E:\Global Blue\globalblue-selenium-test\gb-selenium-test\lib\IEDriverServer_Win32_2.28.0\IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
driver = new InternetExplorerDriver();

The tests are running in Internet Explorer well. How can I use different version of IE (IE6, 7, 8, 9 and 10) in my Selenium WebDriver test?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The IE driver will use whatever version of IE is installed on the machine. There is no supported way to run multiple versions of IE on the same operating system installation. While there are solutions that claim to do so, they are all lacking in some way. Even using different document modes are not perfect, and there is no way in the IE driver to programmatically set the document mode.

The way to run different versions of IE with the IE driver is to use a different Windows installation for each version of IE you want to run against. Virtual machines are a wonderful approach to this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...