嗨,我正在用geb运行我的功能测试。我能够正确地在本地计算机上运行测试。但是当我将我的应用程序部署到服务器时。功能测试的构建失败。
这是我的控制台输出
|Running 10 spock tests... 1 of 10
Failure: |
sign in with voucher
|
geb.driver.DriverCreationException: failed to create driver from callback 'script14007213321291157436758$_run_closure1@77068fce'
at geb.drive
我正在运行Google规范示例,即:
class GoogleHomePageSpec extends GebReportingSpec {
def "first result for wikipedia search should be wikipedia"() {
given:
to GoogleHomePage
expect:
at GoogleHomePage
when:
search.field.value("wikipedia")
then:
waitFor { at Googl
我正在尝试使用Geb测试我的主页是否受到Spring Security的保护。
这是我的测试:
void "Unauthenticated user is redirected to login page."() {
given:
to HomePage
via AuthPage
expect:
at AuthPage
}
当我尝试运行此测试时,geb显示我的断言失败。它显示我在我的AuthPage中,而不是我的HomePage中。
这是堆栈跟踪:
| Failure: Unauthenticated user is redirected to lo
我很难从IntelliJ IDE运行我的功能测试。在运行功能测试时,会收到以下错误消息:
java.lang.IllegalStateException: No reports dir has been configured, you need to set in the config file or via the build adapter.
at geb.Browser.getReportGroupDir(Browser.groovy:899)
at geb.Browser.cleanReportGroupDir(Browser.groovy:932)
at g
我刚开始使用Geb,在从Geb书中输入示例代码时遇到了这个错误:
import geb.Browser
Browser.drive {
go "http://google.com/ncr"
// make sure we actually got to the page
assert title == "Google"
// enter wikipedia into the search field
$("input", name: "q").value("wikipedia
我正在使用Geb/Spock进行自动化测试。我正在使用Gradle作为我的构建工具。
我想调用不同的gradle任务来构建和运行特定的规范(测试)或一套规范。
我对gradle构建生命周期不太了解,无法完全理解这里发生了什么:
plugins {
id "idea"
id "groovy"
id "com.energizedwork.webdriver-binaries" version "1.4"
id "com.energizedwork.idea-base" version &
我有自己的硒网格和不同的窗口机器。其中之一是Windows 10机器。Chrome和Firefox可以工作,但我不能让Edge运行。
我的例外是:
geb.driver.DriverCreationException: failed to create driver from callback 'script1460298173607577952326$_run_closure3@6256ac4f'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driv
我已经创建了一个简单的hello world应用程序,这里是用确认块测试的规范。
当我运行函数测试时,它会抛出错误。
No signature of method: geb.navigator.NonEmptyNavigator.getJs() is applicable for argument types: () values: []
Possible solutions: getX(), getY(), getX(), getY(), getAt(groovy.lang.EmptyRange), getAt(groovy.lang.Range)
groovy.lang.MissingM
我想遍历页面列表,验证每个页面的内容
使用GEB,我想迭代遍历eg。然后,https://github.com/trending访问trending中的每一页并验证标题,然后继续下一页。
然而,org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document错误困扰着我。
@Grapes([
@Grab('org.gebish:geb-core:3.3'),
@Grab('org
我正在试着通过gradle进行geb测试。我已经安装了这些
java版本"1.8.0_31“
Groovy版本: 2.4.0
第2.3级
但是我在运行测试时会遇到这个错误。
Exception in thread "main" java.lang.NoClassDefFoundError: java/util/HashMap$Ent
ry
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Cl
所以我写了我的第一个Geb脚本,它扩展了GebReportingSpec。我已经指定了一个def清理,在其中我执行一个driver.quit()。现在浏览器确实关闭了,但是我得到了一个错误,因为屏幕截图实用程序无法运行,因为我猜它在浏览器关闭后运行。我试着睡了一觉,想看看这是否是问题所在,但这没什么用。
JUnit 4 Runner, Tests: 1, Failures: 1, Time: 25944Test Failure: Validate that the default time zone for store is set to America/New_York(groovy.ma
我的ChromeDriver出现以下错误,但我找不出原因。Chrome是68版本,chromedriver是2.41。这会抛出以下错误,甚至不会打开Chrome浏览器。
Aug 08, 2018 5:08:23 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
Starting ChromeDriver 2.41.578737 (49da6702b16031c40
作为Happy Trails应用程序的一部分,我正在尝试从Grails 2.0.3升级到2.2.1。
我遇到的第一件事就是让Geb/Spock与Groovy 2一起工作,当我试图安装插件或做任何事情时,我得到了以下错误。
| Resolving plugin JAR dependencies
| Error WARNING: Dependencies cannot be resolved for plugin [mail] due to error: startup failed:
Could not instantiate global transform class org.spockf
Selenium网格(selenium-server-standalone-3.0.1)在Win7 32位节点上不能与IE 11一起工作。IE浏览器窗口已打开,但未执行测试。只有消息"This is the initial start page for the WebDriver server“。在IE中显示。
Option Groovy)“是在GEB/ "caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,框架中设置的。
FF和Chrome在节点上
我正在尝试为Geb库()运行一个基本示例。代码如下:
import geb.Browser
Browser.drive {
go "http://google.com/ncr"
// make sure we actually got to the page
assert title == "Google"
// enter wikipedia into the search field
$("input", name: "q").value("wikipedia")
我想做一些相互依赖的测试。因此,我有一个“主”-Test,它应该调用其他测试。下面是两个示例类:
@Stepwise
public class TestClass extends GebReportingSpec{
NotAutomaticExecutedIT test = new NotAutomaticExecutedIT();
def "anderen Test aufrufen"() {
given:
test."test"()
when:
def wert = true
then:
在IntelliJ集成开发环境中运行Geb测试时,我得到了以下错误。
org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: features.step_definitions.MyHomeStepDef.to() is applicable for argument types: (java.lang.Class) values: [class geb.pages.MyLandingPage]
Possible sol