Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

As I have used Groovy language along with Geb to test my web application, As the login page consists of only name instead of id , When i test it with Groovy it shows error. While i run with id it is executed successfully.

my code below is

  //this program runs with groovy as it uses element 'id'
  browser.go "https://duckduckgo.com/"
  //fill the search input field with the searchterm
  ".q" is just a shortcut for find("input", name:"q")
  browser.find("#search_form_homepage").q = "Groovy Browser Automation"
  // click the button with id "search_button_homepage"

But with the second part I am testing with my local host with element 'name' the code is below here

  // this program runs with element 'name'
  browser.go ""
  browser.find("#userName").y = "administrator"
  browser.find("#password").x = "welcome"

Exception thrown
25 Mar, 2014 11:21:58 AM org.codehaus.groovy.runtime.StackTraceUtils sanitize
            WARNING: Sanitizing stacktrace: groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: y for class: geb.navigator.EmptyNavigator

So how to test with element name with Groovy and Geb.

share|improve this question
It's a Geb but not Selenium 2 (WebDriver) –  olyv Jun 12 '14 at 19:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.