“result is null” error when working around _blank deficiency in Selenium IDE

天涯浪子 提交于 2019-12-25 08:33:17

问题


Using a workaround to be able to check the contents of a new tab, I get unexpected results. If I play the test case, the following line fails:

storeEval | javascript{"selenium.browserbot.getCurrentWindow().open('', 'my_window')"} | my_window

with the following error message:

[error] Threw an exception: result is null

The following alternative statements show the exact same symptoms:

getEval | window.open("", "my_window")
getEval | selenium.browserbot.openWindow("", "my_window")

Now, if I double-click it, it doesn't fail, but it opens up a new window, which I think the original solution didn't intend (the next step is to click on a link in the parent window, after all). At this point I can click on the parent window, manually run the next step to launch the link, manually change back to the child window (selectWindow | my_window says it can't find that window), and manually run each of the following steps to check the contents of the new window.

How do I proceed from here to make the test properly automatic?

Update: There is a built-in action for opening windows, but it also fails. Maybe this verbatim log output can shed some light on what's going on:

[info] Executing: |store | license_window | windowName |
...
[info] Executing: |openWindow | | ${windowName} |
[error] Unexpected Exception: fileName -> chrome://selenium-ide/content/recorder.js, lineNumber -> 74

The relevant lines from recorder.js:

66: window.open = function(url, windowName, windowFeatures, replaceFlag) {
...
74:            if (result.wrappedJSObject) {
75:                result = result.wrappedJSObject;
76:            }

回答1:


It seems that your browser doesn't allow pop-up for your web site. Go to options > Content > Exceptions for block pop-up windows and add your web site address.



来源:https://stackoverflow.com/questions/10092693/result-is-null-error-when-working-around-blank-deficiency-in-selenium-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!