geb

Unable to check the checkbox in GEB

跟風遠走 提交于 2019-12-11 09:58:39
问题 I am trying to check my check box in Geb. I have tried following codes, but no luck $('input', type:'checkbox', id: 'chkTermsConditions', tabindex: '-1').value('true') $(".CheckBoxUI").value('true') Following is the HTML After mouse go over the check box additional text updated (marked in the screen shot) 回答1: You are attempting to check the box which has the attribute with value='true' From the Geb manual: The value of input, select and textarea elements can be retrieved and set with the

geb.error.PageInstanceNotInitializedException

六眼飞鱼酱① 提交于 2019-12-11 08:00:22
问题 I am new in using Geb and Cucumber for grails and I am following this tutorial https://github.com/hauner/grails-cucumber/wiki/Testing-Grails-with-Cucumber-and-Geb Everything has been fine up until I made a Page class and used it in my step definition. I ran the test and this error showed up. Error running forked test-app: Instance of page class pages.ListPage has not been initialized. Please pass it to Browser.to(), Browser.via(), Browser.page() or Browser.at() before using it. (NOTE: Stack

Geb authoring support within Intellij-IDEA?

隐身守侯 提交于 2019-12-11 02:47:24
问题 The Geb documentation says that IDEA supports Geb via the Groovy plugin (http://www.gebish.org/manual/current/ide-and-typing.html#intellij_idea_support). In particular, it says " IntelliJ IDEA (since version 12) has special support for authoring Geb code. This is built in to the Groovy support; no additional installations are required." However, I'm not seeing this in IDEA 13.x or 14. Everything works and runs, but I get no code completion or hinting for any content DSL definitions defined in

geb geckodriver not working properly (launching multiple browser window)

天涯浪子 提交于 2019-12-11 00:23:52
问题 I want to use geb with multiple browsers, specifically with firefox. However I am getting the firefox launching multiple windows without inserting the url., and ultimately failing. However, I have had no problem with chrome. Chrome is working perfectly. I am using firefox 57.0.4 (32-Bit), geckodriver 0.20.1 and selenium 3.11.0. This is how I did the configuration for firefox(geckodriver) in the GebConfig.groovy file. driver = { System.setProperty("webdriver.gecko.driver", "C:\\Data\\selenium\

How can I get WebDriver to dismiss a Firefox Security Alert?

江枫思渺然 提交于 2019-12-10 16:23:41
问题 I am writing a test script using spock, geb, and WebDriver. The script submits a form on an insecure page. The page submits to a secure HTTPS URL. Firefox shows a warning for this, specifcally: This causes the following error: org.openqa.selenium.UnhandledAlertException: Modal dialog present Build info: version: '2.23.0', revision: '17137', time: '2012-06-07 09:08:12' System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.4', java.version: '1.6.0_33' Driver info: driver

Can't pass closures in groovy

ぃ、小莉子 提交于 2019-12-10 15:26:39
问题 I am trying to run a basic example for the Geb library (http://www.gebish.org/manual/current/intro.html#introduction). Here is the code: 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") // wait for the change to results page to happen // (google updates the page dynamically without a new request) waitFor { title.endsWith("Google

Class cannot resolve module as content unless @Stepwise used

独自空忆成欢 提交于 2019-12-10 15:22:52
问题 I have a Spock class, that when run as a test suite, throws Unable to resolve iconRow as content for geb.Page, or as a property on its Navigator context. Is iconRow a class you forgot to import? unless I annotate my class with @Stepwise. However, I really don't want the test execution to stop on the first failure, which @Stepwise does. I've tried writing (copy and pasting) my own extension using this post, but I still get these errors. It is using my extension, as I added some logging

How to run more than one test but not all the tests in GEB using Gradle?

旧街凉风 提交于 2019-12-10 12:13:42
问题 I am running gradle to run the tests from Windows command line. What I do to run a single test is: gradlew.bat chromeTest -DchromeTest.single=test1Spec or for all the tests: gradlew.bat chromeTest If I try to run only two test classes like this: gradlew.bat chromeTest -DchromeTest=test1Spec,test2Spec--info then gradle starts to run all the tests. What I need: is to run only 2 or 3 Groovy classes. To be specific, neither one nor all. Any help would be really beneficial! Sorry, for reposting

Selenium addCookie getting Invalid Cookie Domain Exception even though I'm on the right domain

大憨熊 提交于 2019-12-10 07:27:49
问题 So I'm trying to load previously saved cookies into my web driver with Selenium/Geb. First I goto the domain and then try to add the cookies. But the cookie domain and the url domain don't register with each other: Caught: org.openqa.selenium.InvalidCookieDomainException: You may only add cookies that would be visible to the current domain: .domain=.example.com => .www.example.com Build info: version: '2.35.0', revision: '8df0c6bedf70ff9f22c647788f9fe9c8d22210e2', time: '2013-0 8-17 12:46:41'

Customize 'at' with extra parameters for the closure?

回眸只為那壹抹淺笑 提交于 2019-12-08 02:32:31
问题 Is it possible to specify some optional parameter(s) to the 'at' closure on the page like this: class ManagerDashboardClientsPage extends Page { static at = { year, geo -> if (year) { GebUtil.selectedYear == year } title.endsWith('Dashboard: Clients') } } so that I can write both at ManagerDashboardClientsPage and at ManagerDashboardClientsPage(2013, 'North East') Currently the first one breaks with No signature of method: page.ManagerDashboardClientsPage$__clinit__closure1.doCall() is