how to click the post button for the following ?
<input class="k-button" type="button" style="width:90px;font-weight:bold;font-size:13px" onclick="Post();" value="Post">
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.Sign up to join this community
You have the following options:
driver.findElement(By.className="k-button").click(); // Do not work if you have several HTML elements with the k-button CSS class on the same page driver.findElement(By.xpath("//input[@onclick='Post();']")).click; //Do not work if you have several HTML elements with this onlick action on the same page driver.findElement(By.xpath("//input[@value='Post']")).click; // Do not work if you have a multy language web app
But I do not know the complete HTML code, so I cannot say if this unique locators are. If not, XPath and the
and operator or the index of the found elements should help.