简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM