我在测试帐户创建过程时遇到问题。下面是我得到的错误:
Object [object HTMLIFrameElement] has no method 'getCurrentWindow'
com.thoughtworks.selenium.SeleniumException: Object [object HTMLIFrameElement] has no method 'getCurrentWindow'
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
at com.thoughtworks.selenium.DefaultSelenium.waitForPageToLoad(DefaultSelenium.java:635)
at com.thoughtworks.selenium.Selenium$waitForPageToLoad$0.call(Unknown Source)
at grails.plugins.selenium.SeleniumWrapper.waitForPageToLoad(SeleniumWrapper.groovy)
at com.thoughtworks.selenium.Selenium$waitForPageToLoad.call(Unknown Source)
at grails.plugins.selenium.meta.AndWaitDynamicMethod.invoke(AndWaitDynamicMethod.groovy:33)
at grails.plugins.selenium.SeleniumWrapper.methodMissing(SeleniumWrapper.groovy:125)
at tokenadmin.SignUpTests.testManualSignUp(SignUpTests.groovy:33)下面是截图:

相关代码部分:
selenium.waitForElementPresent("css=#registerForm");
selenium.type("name=name", "selenium test 1");
selenium.type("name=email", emailAddress);
selenium.type("css=input[tabindex=\"13\"]", "123123");
selenium.type("name=password1", "123123");
selenium.type("css=input[tabindex=\"14\"]", "123123");
selenium.type("name=password2", "123123");
selenium.submitAndWait("css=#registerForm")
assertTrue(selenium.isTextPresent("Please confirm your e-mail address"));有什么好主意吗?
更新:
我将所有内容都更改为localhost:8080,然后它突然开始工作了。不过,我不知道为什么。
发布于 2012-03-09 23:30:57
将项目url更改为localhost:8080后,它开始工作
发布于 2011-12-13 00:48:29
你不能这样做,因为Javascript的安全规则。localhost上的脚本只能访问基于localhost的框架。
https://stackoverflow.com/questions/8422285
复制相似问题