How to Launch Winium Driver using Java? (Winium.Desktop tool is useful to handle desktop based Application)
public WiniumDriver driver=null;
public DesktopOptions options;
public String DesktopAppPath="C:\\Windows\\System32\\Calc.exe";
@BeforeMethod
public void OpenCalculator()
{
// Please restart Winium.Desktop Driver before you proceed. There is some security reason, not able to start in Cognizant machine
options= new DesktopOptions();
options.setApplicationPath(DesktopAppPath); // like driver.get method
try{
driver=new WiniumDriver(new URL("http://localhost:9999"),options);
Thread.sleep(4000);
}
catch(Exception e){
System.out.println(e.getMessage());
}
public WiniumDriver driver=null;
public DesktopOptions options;
public String DesktopAppPath="C:\\Windows\\System32\\Calc.exe";
@BeforeMethod
public void OpenCalculator()
{
// Please restart Winium.Desktop Driver before you proceed. There is some security reason, not able to start in Cognizant machine
options= new DesktopOptions();
options.setApplicationPath(DesktopAppPath); // like driver.get method
try{
driver=new WiniumDriver(new URL("http://localhost:9999"),options);
Thread.sleep(4000);
}
catch(Exception e){
System.out.println(e.getMessage());
}
No comments:
Post a Comment