I am running a Selenium WebDriver Script in java to read excel file and write data in a Web application. I am instantiating a Firefox Webdriver. The problem is that Script runs fine, but when test case is running and i click somewhere on the Web application Screen, web driver Stops running or even when i change focus to some other Window ..it stops.

I am using latest Selenium java client version and latest firefox version with Eclipse.I don't know why its giving such focus issue?

  • 1
    Can you put a code snippet in your question please? And what exactly means "Stop running"? Will a exception be thrown? With this information we can give you better answers. Thank you.
    – Twaldigas
    Dec 5 '14 at 8:08
  • Why do you manually try to interfere with a running test? Apr 7 '15 at 11:22
  • Have you considered running your script with PhantomJSDriver? It runs headless. Apr 7 '15 at 11:56

I have experienced the same thing. I believe that for some reason it stops executing Java scripts on the page once the focus to the browser is lost.

My quick workaround was to create a Linux VM on my Mac, and do all the testing (and development) in it, because then the browser is always in focus, even when you do other stuff in the host OS.

  • Installing and running the tests on a VM sounds like a good idea when you need to continue working on your development machine. Apr 7 '15 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.