Search code examples
testinggroovygeb

How to check if a href element find in geb


I try to click html css 'a' but I cant access to it. How can I to do?

at test

waitFor { myelement.displayed }
myelement.click()

class test extends Page {

    static at = { title == "test page" }
    static content = {
        myelement {$("a", id: "myid")}
    }
}

Solution

  • You should be able to access it directly using the ID. I think your syntax is incorrect, try using the ID selector instead: $("#myId")