我的项目没有通过硒测试。
seleniumconfig.groovy有以下代码:
selenium {
slow = true
singleWindow = true
browser = "*iexploreproxy"
url = null
defaultTimeout = 60000
windowMaximize = false
screenshot {
dir = "./target/test-reports/screenshots"
onFail = false
}
server {
host = "localhost"
port = 4444
}
}NewTests.groovy文件包含以下代码:
package gtunes
import grails.plugins.selenium.*
import org.junit.*
import static org.junit.Assert.*
import static org.hamcrest.Matchers.*
@Mixin(SeleniumAware)
class NewTests {
class HomepageTests extends GroovyTestCase {
void testHomepageLoads() {
selenium.openAndWait "http://www.facebook.com/login.php"
assertTrue selenium.isTextPresent("facebook")
}
}运行命令"test-app is :“时显示的输出STS
30000 at后超时:在com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91) at grails.plugins.selenium.SeleniumWrapper.open(SeleniumWrapper.groovy:53) at grails.plugins.selenium.meta.AndWaitDynamicMethod.invoke(AndWaitDynamicMethod.groovy:32) at grails.plugins.selenium.SeleniumWrapper.methodMissing(SeleniumWrapper.groovy:125) at automation.HomeTests.testHomepageLoads(HomeTests.groovy:14)
我的项目没有通过测试。如何纠正这个问题?
命令历史记录是 :getTitle() setContext(a87ff87c1ae249be99c6363519627de8) windowMaximize() setContext(HomeTests: test主页加载)打开(http://www.facebook.com/login.php,true)
发布于 2012-02-08 18:29:16
路径变量中有firefox吗?Selenium需要从安装dir启动firefox实例,并且需要知道在哪里有dir。
发布于 2012-02-18 03:55:55
我也面临着同样的问题。你的设置在我看来很好。尝试以下命令:
test-app :selenium
https://stackoverflow.com/questions/9191302
复制相似问题