JTAF-ExtWebDriver
JTAF-ExtWebDriver copied to clipboard
NPE and conditional in DefaultExtWebDriver#selectPopupWindow
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.
Can we come up with a unit test which forces this condition?
The test(s) probably needs to go into BrowserOnlyTest suite, instead of build unit tests with HtmlUnit since it deals with windows.
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.
In that case, could we include the manual steps to reproduce?
Yes, that makes sense.