I have this button:-
<div class="dsk-col-1-4 card new">
<div class="div_center_div">
<span class="icon icon_plus-black-symbol"></span>
<h2>Create</h2>
</div>
</div>
But I tried with find element by classname:-
driver.findElementByClassName("dsk-col-1-4 card new").click();
But it does not work. Any help?
We can select each div separately that have the same class with the help of the Selenium webdriver.
From the Elements panel in Chrome's Developer Tools, you can press Ctrl+F and enter an XPath to view the search results for an XPath selector.
Move to your element and click. Example:
new Actions(driver).MoveToElement(yourElement).Click().Perform();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With