Selenium | Unable to find Command button using Selenium Webdriver

Author - Webner

Problem: Unable to find the Command button using Selenium Webdriver.

Solution: You can use following script code if you want to find command button on a web page and then click it:

driver.findElement(By.xpath("//button[text()='(Button name)']")).click();

Here is the script which we used in Webdriver:

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Start
public static void main(String[] args)
WebDriver driver = new FirefoxDriver();
driver.findElement(By.xpath("//button[text()='Ver Encuesta']")).click();
Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published.