-1

I am writing Selenium scripts to test my webpage. To simulate testing, a desktop application resets the date in the DB (as the actual process is run after the date changes).

Now I am able to call my application and click the button through Selenium by Runtime.getRuntime().exec("E:\\AutoIT\\DBReset.exe");, but I am unable to return the control to Selenium after the reset is done.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

2

When you perform the operation by AutoIt using:

Runtime.getRuntime().exec("E:\AutoIT\DBReset.exe");

Selenium still holds the focus to the web page. So once the Windows dialog box closes, Selenium should be able to execute the next line of code.

In case Selenium complains of lost focus you can use JavascriptExecutor to gain back browser focus :

  • Java :

    ((JavascriptExecutor) driver).executeScript("window.focus();");
    
user4157124
  • 2,809
  • 13
  • 27
  • 42
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352