0

I"m trying to resolve this issue but to no avail. Here is my Source Code

public class ContactInformationTesting   {

    //Using or Launching Internet Explorer
    String exePath = "\\Users\\jj85274\\Desktop\\IEDriverServer.exe";

    //For use of IE only; Please enable for IE Browser
    WebDriver driver = new InternetExplorerDriver(); 




  @Test
  public void OpenPage_Login() {


        driver.get("http://cp-qa.harriscomputer.com/");
  }
Eugene S
  • 6,709
  • 8
  • 57
  • 91
JJ Whispers
  • 13
  • 1
  • 5

1 Answers1

0

You need to set the System property webdriver.ie.driver before instantiating the InternetExplorerDriver object. I could not find that in your code: Try following:

System.setProperty("webdriver.ie.driver", "<path_to_your_IEDriverServer.exe>");
WebDriver driver = new InternetExplorerDriver();

Let me know, if you still get the same error.

UPDATE: I have assumed that IEDriverServer.exe's local path is C:\Users\jj85274\Desktop\IEDriverServer.exe. You can change it, as per its location on your machine. Try following code and let me know, whether you are able to launch Internet Explorer successfully.

System.setProperty("webdriver.ie.driver", "C:\\Users\\jj85274\\Desktop\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
Mahipal
  • 900
  • 1
  • 5
  • 7
  • When I place into my public class, My Code Turns red stating "Syntax error on token(s), misplaced construct(s)" – JJ Whispers Feb 07 '17 at 15:12
  • This is my updated Source Code //For use of IE only; Please enable for IE Browser System.setProperty("webdriver.ie.driver", exePath); //Using or Launching Internet Explorer String exePath = "\\Users\\jj85274\\Desktop\\IEDriverServer.exe"; //For use of IE only; Please enable for IE Browser WebDriver driver = new InternetExplorerDriver(); – JJ Whispers Feb 07 '17 at 15:12
  • In your code, you have used variable **exePath** before declaring it. Additionally, the path value specified in **exePath** variable is neither relative nor absolute. I would suggest you to first specify the absolute path value for **IEDriverServer.exe** and check whether you are able to launch Internet Explorer successfully. Please see my update answer above. Once, the Internet Explorer can be launched successfully, you can specify the relative path. – Mahipal Feb 08 '17 at 04:52
  • Thank you very much – JJ Whispers Feb 08 '17 at 18:12