简体   繁体   中英

Apart from click() and submit() method is there any other way to select/click a web element in selenium Webdriver?

In 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..?

If you want to click something, why would you use something else? I guess click() is the best method for elements to be clickable.

Still you can use enter to perform the same.

WebElement button = driver.findElement(By.id(""));
button.sendKeys(Keys.Enter);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM