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">
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.