我的项目没有进行硒测试。在grails中使用硒-rc进行测试
的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")
}
}
输出STS是否显示在运行命令“test-app是:
超时后30000ms com.thoughtworks.selenium.SeleniumException:30000ms 在com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) 在com.thoughtworks.selenium.HttpCommandProcessor.doCommand(后超时HttpCommandProcessor.java:91) 在grails.plugins.selenium.SeleniumWrapper.open(SeleniumWrapper.groovy:53) 在grails.plugins.selenium.meta.AndWaitDynamicMethod.invoke(AndWaitDynamicMethod.groovy:32) 在grails.plugins。 seleniumWrapper.methodMissing(SeleniumWrapper.groovy:125) at automation.HomeTests.testHomepageLoads(HomeTests.groovy:14)
我的项目没有通过测试。如何解决这个问题?
命令历史记录是:的getTitle() setContext(a87ff87c1ae249be99c6363519627de8) windowMaximize() setContext(HomeTests:测试网页加载) 开放(http://www.facebook.com/login.php ,true)
我从来没有能够从IDE启动硒测试,你有没有尝试过从命令行? 'grails test-app -functional' – 2012-02-08 14:12:07
我必须使用Spring源代码套件来完成它。 – Shalini 2012-02-09 08:47:41