Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geb + Groovy select custom element with a dash in the attribute name

I am trying to use the Geb jQuery selector on the following element:

<li data-title="Something"><'li>

I have tried the following:

//1
$("li", "data-title": "Something")
//2
$("li", data-title: "Something")

But neither work. Is this possible?

like image 705
jdfolino Avatar asked Feb 27 '15 04:02

jdfolino


1 Answers

You can just use the CSS selector for a custom attribute for this:

$("li[data-title='Something']")
like image 119
jk47 Avatar answered Nov 15 '22 03:11

jk47