0

I am trying to run a cross browser test in selenium using TestNG. It works fine in Firefox and Chrome, but not in IE. Script opens IE and on load, it points to URL - http://localhost:16189/ It doesn't navigate to base url.

Below is my config from testng.xml

<test name="IETest">

<parameter name="browser" value="IE" />

<classes>

<class name="crossbrowserpack.CrossBrowserScript">

</class>

</classes>

</test>

Below is the instance creation code for IE in my code.

if(browser.equalsIgnoreCase("ie")){
System.setProperty("webdriver.ie.driver","C:\\IEdriver.exe");
                //create IE instance
                driver = new InternetExplorerDriver();
            }

Below is my test method.

public void testParameterWithXML() throws InterruptedException{
        driver.get("http://newtours.demoaut.com");
genespos
  • 3,211
  • 6
  • 38
  • 70
Naresh
  • 99
  • 3
  • 14

1 Answers1

0

pls cross check your version of internetexplorerdriver and IE instance you are trying to automate.

Also add desired capabilities

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);

System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver(capabilities);

Have you renamed IEDriverServer.exe to IEDriver.exe?

parishodak
  • 4,506
  • 4
  • 34
  • 48
  • Thank you. Yes, I have renamed the exe file name. – Naresh Dec 14 '15 at 18:32
  • Yes. I added the code for desired capabilities and changed the browser zoom size. Had to add a wait command to run test successfully on IE. – Naresh Dec 14 '15 at 18:42