mardi 19 juillet 2016

how to find web element with Selenium with multiple string matches

I have to click buttons: onclick ='JavaScript:go_detail("2009091701206002")' onclick ='JavaScript:go_img("2009091701206002")'

I want to find the first click button and click on it. when I try to run Xpath with all the string 'JavaScript:go_detail("2009091701206002")' I have problem and I don't find the element because of the double quote.

please don't try to help me run it with the all value. I need to ask for element that have the sub stringד "go_detail" and "2009091701206002". How can I run find element with two sub strings? (xpath, cssSelector)

I tried: driver.findElement(By.cssSelector("input[onclick^='JavaScript:go_detail'*='2009091701206002']"));

Thanks

Aucun commentaire:

Enregistrer un commentaire