0

I'm trying to automate the windows based application which is developed using RCP Eclipse. I'm using WinApp driver to launch the application and automate using selenium. I'm not able to launch the application , I'm not getting any error for launching but I couldn't see the application launched, it is taking time it seems, meanwhile I'm getting "element not found" exception.

Example:

DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.setCapability("app", "D:\\NewTest\\eclipse\\eclipse.exe");
appCapabilities.setCapability("platformName", "Windows");
appCapabilities.setCapability("deviceName","WindowsPC");
appCapabilities.setCapability("session-override", true);
try {
    driver = new WindowsDriver(new URL("http://127.0.0.1:4723"), appCapabilities);
    System.out.println("Connection success");
     } 
catch (MalformedURLException e) {
   e.printStackTrace();
   }        
driver.findElementByName("HatsTry01").click(); 
greg-449
  • 109,219
  • 232
  • 102
  • 145
Anita
  • 1
  • 1

1 Answers1

0

It looks like you're starting Eclipse for your test instead of your app. This has the driver searching the Eclipse UI for your app's custom UI elements. You will need to start your app directly to be able to interact with it via winappdriver.

This will have the added benefit of greatly reducing the computational load of your test environment since it will no longer need to support Eclipse as a test dependency.

sphennings
  • 998
  • 10
  • 22