1
<button class="hbutton" h:click="app.items(client.monthlyItems)" style="">Start</button>

How do I use regex in css locator to find h:click="app.items(client.monthlyItems)" for class=hbutton?

2 Answers 2

1

Not sure what language binding you are using, but you should be able to use xpath to find what you need. Here's an example in python: Try something like this:

driver.find_element_by_xpath("//@*[contains(., 'app.items(client.monthlyItems)')]")

You can also try a starts-with

//*[@*[starts-with(., 'app.items')]]

More details here

Sign up to request clarification or add additional context in comments.

2 Comments

I have tried this it does not work because atrribute has ":". I am trying to find regex to locate it
Okay I have updated the answer to check with any attribute that contains. See if that works ..
0

You just have to escape the colon (:). You can use the CSS Selector below.

"h1[h\\:click='app.items(client.monthlyItems)']"

How to use JSF generated HTML element ID with colon ":" in CSS selectors?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.