Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
622 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...