To run selenium webdriver in IE browser, we need InternetExplorerDriver which is a standalone server which implements WebDriver's wire protocol.
First of all, download latest version of IEDriver server for webdriver. You can download latest version server from Download InternetExplorerEDriver
Note: Choose the IEdriver server based on your working environment as there are two different zip files for both 32 and 64 bit IE . If you are working on windows 32 bit system, please select and click on IEDriverServer_Win32_2.xx.0.zip to download
Save the downloaded file to your local machine.
In you code you need to set the system property for IE driver as
System.setProperty("webdriver.ie.driver", "pathofchromedriver\\IEDriverServer.exe");
Please find the below example program for running webdriver in IE browser
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class ieBrowser {
public static void main(String args[])
{
System.setProperty("webdriver.ie.driver", "d://IEDriverServer.exe");
WebDriver driver=new InternetExplorerDriver();
driver.get("http://seleniumeasy.com");
}
}
As we all know, InternetExplorerDriver works only with Windows system and the execution speed is slow Comparatively to other browsers.
Most of the time when working with Internet explorer, we may end up seeing issues such as 'NoSuchElementFound' exception because of Synchronization
However when working with InternetExplorerDriver there are some issues with mouse events when the browser window does not have focus, and attempting to hover over elements.
Your test scripts may work fine with Firefox and Chrome browsers which are intelligent enough find the elements in the DOM, but Internet Explorer is slow because of which you will end up with an exception.
To avoid issues when executing scripts with Internet explorer, try to use 'Css selectors' which will minimize your issues.
If you are facing any problem running your scripts in Internet Explorer, please refer InternetExplorerDriver Required_Configuration
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন