Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to automate an application using Selenium Webdriver. The moveToElement function fails when the browser is minimized or not active (keep other app active). It works when I keep AUT browser as the active window.

My code:


Here is the error:

java.lang.Exception: //div[contains(@class,'profileCardBtnsContainer')]//dt[text()='Actions'] is not found on the page with in the time period
 [java]     at
 [java]     at
 [java]     at
 [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 [java]     at java.lang.reflect.Method.invoke(Unknown Source)
 [java]     at org.testng.internal.MethodInvocationHelper.invokeMethod(
 [java]     at org.testng.internal.Invoker.invokeMethod(
 [java]     at org.testng.internal.Invoker.invokeTestMethod(
 [java]     at org.testng.internal.Invoker.invokeTestMethods(
 [java]     at org.testng.internal.TestMethodWorker.invokeTestMethods(
 [java]     at
 [java]     at org.testng.TestRunner.runWorkers(
 [java]     at org.testng.TestRunner.privateRun(
 [java]     at
 [java]     at org.testng.SuiteRunner.runTest(
 [java]     at org.testng.SuiteRunner.runSequentially(
 [java]     at org.testng.SuiteRunner.privateRun(
 [java]     at
 [java]     at org.testng.SuiteRunnerWorker.runSuite(
 [java]     at
 [java]     at org.testng.TestNG.runSuitesSequentially(
 [java]     at org.testng.TestNG.runSuitesLocally(
 [java]     at
 [java]     at org.testng.TestNG.privateMain(
 [java]     at org.testng.TestNG.main(
share|improve this question
I do not expect Webdriver to work when the brower is minimized. – user246 Jan 30 '12 at 12:21
Not sure what the question is here... Yes your assertion is correct WebDriver doesn't work properly when the browser is minimised. This is because it uses native events to click on the browser rather than just emulating clicks with JavaScript so if it isn't there to click on the clicks don't work. – Ardesco Feb 6 '12 at 16:57

WebDriver does not work properly when the browser is minimized.

share|improve this answer
if web driver is openig multiple browsers, can you close them after x seconds? – Thufir Oct 6 '14 at 11:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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