geb

How to find the row that contains a specific string in GEB and in that particular row I need to select a link/checkbox

妖精的绣舞 提交于 2020-01-07 06:44:10
问题 Is there any way to find the row number/index that contains a specific string in GEB? I can check whether a row contains a specific string or not with: text: contains() But how can I find the index of that row and then click on a link in the same row using that index ID? Any suggestion or help would be really appreciated. Please don't say what did I try so far. I spent few hours already and still no way! EDIT: Okay, so the problem was: I can select any row with known index, for instance: $('p

How to find the row that contains a specific string in GEB and in that particular row I need to select a link/checkbox

瘦欲@ 提交于 2020-01-07 06:44:07
问题 Is there any way to find the row number/index that contains a specific string in GEB? I can check whether a row contains a specific string or not with: text: contains() But how can I find the index of that row and then click on a link in the same row using that index ID? Any suggestion or help would be really appreciated. Please don't say what did I try so far. I spent few hours already and still no way! EDIT: Okay, so the problem was: I can select any row with known index, for instance: $('p

Grails - functional test with Geb doesnt work with HtmlUnitDriver

别说谁变了你拦得住时间么 提交于 2020-01-05 08:36:08
问题 I have created a functional test, which works fine when driver is FireFox or Chrome. The same fails when i try to use HtmlUnit driver. The application gets started, but gets stuck while running the first test. Then i have kill the java process to stop it. Pasting the code snippet that i use to initialize the htmlunit driver driver = { def driver = new HtmlUnitDriver() driver.javascriptEnabled = true baseUrl = 'http://localhost:8585' driver } 回答1: Which version of grails are you using?

Grails - functional test with Geb doesnt work with HtmlUnitDriver

六眼飞鱼酱① 提交于 2020-01-05 08:35:23
问题 I have created a functional test, which works fine when driver is FireFox or Chrome. The same fails when i try to use HtmlUnit driver. The application gets started, but gets stuck while running the first test. Then i have kill the java process to stop it. Pasting the code snippet that i use to initialize the htmlunit driver driver = { def driver = new HtmlUnitDriver() driver.javascriptEnabled = true baseUrl = 'http://localhost:8585' driver } 回答1: Which version of grails are you using?

Testing Angular dynamic page content (ng-if) with Geb

╄→尐↘猪︶ㄣ 提交于 2020-01-03 16:14:52
问题 I am trying to test if an Angular ng-if element is visible or not using Geb. So far I've attempted to test if the displayed property is true or false as follows. Angular: <article ng-if="!condition" class="bar foo ng-scope">Text to Display</article> Geb UI Module: unselectedErrorText { $(class: "bar foo ng-scope") } Test: assertThat(unselectedErrorText.displayed).isFalse() checkBox.value()==false assertThat(unselectedErrorText.displayed).isTrue() I am getting the following error: The required

Not able to maximize Chrome Window in headless mode

╄→尐↘猪︶ㄣ 提交于 2019-12-30 03:56:06
问题 I recently upgraded my chrome version to 60 and chromedriver to version 2.31. Post that I have started getting the following exception when I try to do a maximize of the browser window. driver.driver.manage().window().maximize() org.openqa.selenium.WebDriverException: unknown error: failed to change window state to maximized, current state is normal (Session info: chrome=60.0.3112.78) (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.2.0-27

How to grab the value of the span element using jQuery

╄→гoц情女王★ 提交于 2019-12-26 11:39:32
问题 I have the following code: <tr> <td Width="50%" align="left"> <span id="ctl00_lblTotalDesc">Ext. Subtotal</span></td> <td Width="50%" align="right"> <span id="ctl00_lblTotalValue">100,087,000.00</span></td> </tr> I used the following to grab the value of the 2nd span element: spanValue = $('#ctl00_lblTotalValue').text(); But this doesn't seem to work in Spock/Geb. I get the following error: TypeError: $(...).text is not a function What am I doing wrong I get the following error if I use, $('

How to grab the value of the span element using jQuery

时光总嘲笑我的痴心妄想 提交于 2019-12-26 11:39:10
问题 I have the following code: <tr> <td Width="50%" align="left"> <span id="ctl00_lblTotalDesc">Ext. Subtotal</span></td> <td Width="50%" align="right"> <span id="ctl00_lblTotalValue">100,087,000.00</span></td> </tr> I used the following to grab the value of the 2nd span element: spanValue = $('#ctl00_lblTotalValue').text(); But this doesn't seem to work in Spock/Geb. I get the following error: TypeError: $(...).text is not a function What am I doing wrong I get the following error if I use, $('

Geb select element that contains something

感情迁移 提交于 2019-12-25 05:16:13
问题 How do I select the value of a form select field when it has random numbers in its name? <select name="select_(random numbers)"> <option value="1"></option> </select> I have tried: formValidity {$("form").(contains('validity')) = "1 year"} which fails. 回答1: There are a few ways to achieve this: formValidity { $("form select[name*='validity']") } formValidity.value("1 year") You were trying to use the Geb way. Geb Selecting Manual You can also use CSS and jquery selectors which I used above

Spock: How to use test data with @Stepwise

我与影子孤独终老i 提交于 2019-12-25 04:21:04
问题 I used @Stepwise for automation. 8 test methods are running sequentially to complete the process. One of the methods take parameter and I want to pass different parameters to the method. But the problem is: The method takes first set of parameter, then parameters are processed AND instead of proceeding to the next method, the method takes next set of parameter. The source looks like: @Stepwise class AOSearchPageTest extends GebReportingSpec { def "first_method"() { } def "second_method"() {