Share
Go down
popsha
Amateur
Amateur
Posts : 60
Join date : 2012-04-14

Problem in handling pop-up

on Tue Apr 24, 2012 3:27 pm
from my main window i need to click the link "view/update" which pop-up a window,then from the pop-up window i need to click the link "find party" which opens second pop-up. now i need to retrieve data form second pop-up to first pop-up then to the main page.

It was recorded using selenium ide, which i mentioned below:


clicklink=View/Update
waitForPopUpNewWindow30000
selectWindowname=NewWindow
clicklink=Find Party
waitForPopUp
30000
windowFocusAndWait

selectWindowname=undefined
problem is that, when i export these into junit, it becomes like this
selenium.click("link=View/Update");
selenium.waitForPopUp("NewWindow", "30000");
selenium.selectWindow("name=NewWindow");
selenium.click("link=Find Party");
selenium.waitForPopUp("", "30000");
selenium.windowFocus();
selenium.selectWindow("name=undefined");

windowFocusAndWait becomes windowFocus - so that i cannot execute it.

can anyone find solution for this
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: Problem in handling pop-up

on Tue Apr 24, 2012 3:38 pm
are you getting any error??

You can put command like below

Code:
selenium.windowFocus();
Thread.sleep(5000);

_________________
Radical QA
http://radical-qa.blogspot.in/
popsha
Amateur
Amateur
Posts : 60
Join date : 2012-04-14

Re: Problem in handling pop-up

on Tue Apr 24, 2012 3:49 pm
thank you for the quick answer.

i tried with above mentioned code.

it shows errors as follows while in junit

com.thoughtworks.selenium.SeleniumException: ERROR: Element name=submitButton not found
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:112)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:106)
at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:193)
at com.Pro.testPro(Pro.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:230)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: Problem in handling pop-up

on Tue Apr 24, 2012 3:55 pm
You are getting this error because 'Element name=submitButton'.
I am not able to find this element in above mentioned code.
This element operation is after selenium.selectWindow("name=undefined") ??

_________________
Radical QA
http://radical-qa.blogspot.in/
popsha
Amateur
Amateur
Posts : 60
Join date : 2012-04-14

Re: Problem in handling pop-up

on Tue Apr 24, 2012 4:07 pm
yes, your concern is correct, but here the script runs till second pop-up opens. so it cannot find the "Element name".

next line is
selenium.select("name=partyType", "label=Individual");

i felt is the pop-up window has to be focused for a while.
is there an alternative command for that
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: Problem in handling pop-up

on Tue Apr 24, 2012 4:15 pm
okay, you can use waitfor command or you can increase sleep time, currently it is 5000. Adjust it as per your requirements.

This will may solve your problem.

I hope you are looking for same solution what m trying to suggest.

_________________
Radical QA
http://radical-qa.blogspot.in/
popsha
Amateur
Amateur
Posts : 60
Join date : 2012-04-14

Re: Problem in handling pop-up

on Tue Apr 24, 2012 4:33 pm
Message reputation : 100% (1 vote)
thaks a lot rohit. it worked
Sponsored content

Re: Problem in handling pop-up

Back to top
Permissions in this forum:
You cannot reply to topics in this forum