mercredi 16 janvier 2019

How to click on a class with a dynamic variable

I like to be able to search and click by cluster-id-hash="foobar", but I'm unable too. It can't find the element

Here are some examples of the css on the page

<div class="ancCol w33 person-panel" _ngcontent-c6="" cluster-id-hash="KYDQEX8il7BIG2"></div>

or
<div class="ancCol w33 person-panel annColRow" _ngcontent-c6="" cluster-id-hash="5gamjajdkjgPcma">


I've tried this where clusterIdHash is a string that I pass:

driver.findElement(By.cssSelector(".cluster-id-hash='" + clusterIdHash )).click();




Aucun commentaire:

Enregistrer un commentaire