[英]Apart from click() and submit() method is there any other way to select/click a web element in selenium Webdriver?
In Java 在Java中
WebElement button = driver.findElement(By.id(""));
//For clicking the button...
button.click();
Is there any other way to click webElement like radio boxes ,Checkboxes ,buttons etc..? 有没有其他方法可以点击webElement,如收音机盒,复选框,按钮等..?
If you want to click something, why would you use something else? 如果你想点击什么,你为什么要用别的东西? I guess click() is the best method for elements to be clickable. 我猜click()是元素可点击的最佳方法。
Still you can use enter to perform the same. 仍然可以使用enter来执行相同的操作。
WebElement button = driver.findElement(By.id(""));
button.sendKeys(Keys.Enter);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.