Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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:

menu=driver.findElement(By.xpath(OwnerName));
builder.moveToElement(menu).build().perform();

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 main.java.com.ca.saas.UXMedia.utils.Globals.waitForElementPresent(Globals.java:191)
 [java]     at main.java.com.ca.saas.UXMedia.utils.ChatUtils.initiatingChatFromDeviceList(ChatUtils.java:258)
 [java]     at main.java.com.ca.saas.UXMedia.Tests.ChatTests.verifyChatFromDevices(ChatTests.java:1031)
 [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(MethodInvocationHelper.java:76)
 [java]     at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
 [java]     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846)
 [java]     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170)
 [java]     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
 [java]     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
 [java]     at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
 [java]     at org.testng.TestRunner.privateRun(TestRunner.java:749)
 [java]     at org.testng.TestRunner.run(TestRunner.java:600)
 [java]     at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
 [java]     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
 [java]     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
 [java]     at org.testng.SuiteRunner.run(SuiteRunner.java:223)
 [java]     at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
 [java]     at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
 [java]     at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039)
 [java]     at org.testng.TestNG.runSuitesLocally(TestNG.java:964)
 [java]     at org.testng.TestNG.run(TestNG.java:900)
 [java]     at org.testng.TestNG.privateMain(TestNG.java:1182)
 [java]     at org.testng.TestNG.main(TestNG.java:1146)
share|improve this question
2  
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

1 Answer 1

WebDriver does not work properly when the browser is minimized.

share|improve this answer

Your Answer

 
discard

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.