Issue is once the new window is spawn test hangs after the line waitForPageToLoad(3000) and finally times out. Once the test hangs if i manually fire some event in parent window test starts executing normally. So as a solution I tried adding code that selects parent window and fire some event. But this code doesn't work at all. If any one could point out where am I missing something or point out my wrong approach.
Steps I followed :
Click the link that opens new window.(here link=3018)
Once the new window2 opens no further action is automated and test just hangs until timeout interval after which it just throws timeout exception.
Manually fire event(click link=outbox) on parent window1 before timeout interval.
Test start executing normaly and finish successfully.
Code snippet (that works fine once manually firing evnt in parent window) :
selenium.click("link=Last");
selenium.waitForPageToLoad("30000");
selenium.click("link=3018");
selenium.waitForPageToLoad("30000");
selenium.selectWindow("window2");
selenium.selectFrame("relative=up");
selenium.click("687c55");
selenium.waitForPageToLoad("30000");
assertEquals("window2", selenium.getTitle());
selenium.close();
Code snippet (that fails evn after adding code to select window and firing evnt in parent window) :
selenium.click("link=Last");
selenium.waitForPageToLoad("30000");
selenium.click("link=3018");
selenium.waitForPageToLoad("30000");
selenium.selectWindow("window1");
selenium.click("link=Outbox");
selenium.waitForPageToLoad("30000");
selenium.selectWindow("window2");
selenium.selectFrame("relative=up");
selenium.click("687c55");
selenium.waitForPageToLoad("30000");
assertEquals("window2", selenium.getTitle());
selenium.close();
I cannot find any reason why my code still fails after adding code to select parent window and to fire click event. It still just hangs and throws exception after time out. :(
Is there any bug with selenium handling popup windows ? Would like to have any suggestion regarding modification in my approach for handling pop up windows in selenium