JTAF-ExtWebDriver icon indicating copy to clipboard operation
JTAF-ExtWebDriver copied to clipboard

NPE and conditional in DefaultExtWebDriver#selectPopupWindow

Open philiphan opened this issue 11 years ago • 5 comments

The conditional at line 295 currently checks for null, then if null checks for emptiness:

if (currentWindowIds == null && currentWindowIds.size() > 0) {...

This will throw a NullPointerException whenever currentWindowIds is null. Switching the operator from an AND to an OR should avoid the NPE.

The second condition doesn't completely make sense in the context of the method, possibly supposed to be testing for equality rather than for greater than.

philiphan avatar Dec 18 '13 18:12 philiphan

Can we come up with a unit test which forces this condition?

bryantrobbins avatar Dec 23 '13 11:12 bryantrobbins

The test(s) probably needs to go into BrowserOnlyTest suite, instead of build unit tests with HtmlUnit since it deals with windows.

kood1 avatar Dec 23 '13 14:12 kood1

We should locally test this on real browsers (at minimum latest Chrome & FF, IE9) and plan to add browser tests with the BrowserOnlyTest suite later.

kood1 avatar Jan 27 '14 14:01 kood1

In that case, could we include the manual steps to reproduce?

mike-glorioso avatar Jan 27 '14 16:01 mike-glorioso

Yes, that makes sense.

kood1 avatar Jan 27 '14 17:01 kood1