gotoFrame("FrameNameOrId") throws NullPointerException
Brought to you by:
henryju
NullPointerException after changing Frame and clicking a Link:
Website (index.html) contains 2 Frames A and B , every Frame contains a href openning link on same frame
getTestContext().setBaseUrl("http://myserver/webtesting");
beginAt("/index.html");
clickLink("LinkOnFrameA);
gotoFrame("B");
clickLink("LinkOnFrameB) <-- throws NullPointerException
I hope this will be fixed before releasing the 1.4
Thanx
Saleh Matani
Logged In: YES
user_id=923609
Originator: YES
So .. i found out that is more easy to reproduce throwing the NullPointerException , then you can build an easy html page with 2 frames "A" and "B" on index.html
getTestContext().setBaseUrl("http://myserver/webtesting");
beginAt("/index.html");
gotoFrame("A");
gotoFrame("B") <-- throws NullPointerException
Matani
Logged In: YES
user_id=1235926
Originator: NO
OK, the problem was gotoFrame() do not raise an Exception when no frame is found, but the current active windows become "null". That's why the next method you call raises a NPE.
Do not forget to call gotoRootWindow when navigating between frame on the same level.