HomeSelenium

70 plus Selenium WebDriver Commands (Full List)

70 plus Selenium WebDriver Commands (Full List)

70 plus Selenium WebDriver Commands (Full List)

The below is the full list of Selenium WebDriver Commands provided along with the code and video:


get()

The purpose of this command is to open the provided Application URL in the Browser. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.get("http://tutorialsninja.com/demo/");         
              
       }

}

For detailed demonstration of this command, you can watch the below video:


maximize()

The purpose of this command is to maximize the Browser. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              
              driver.manage().window().maximize();
             
       }

}

For detailed demonstration of this command, you can watch the below video:


fullscreen()

The purpose of this command is to switch the Browser to the full screen mode. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              
              driver.manage().window().fullscreen();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


setSize()

The purpose of this command is to set the size of the Browser to a particular size. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              
              Dimension d = new Dimension(300,650);
              driver.manage().window().setSize(d);
              
       }

}

For detailed demonstration of this command, you can watch the below video:


findElement()

The purpose of this command is to help the Selenium in locating the required UI element on the web page using the given locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.get( "http://omayo.blogspot.com/");
              
              WebElement textArea = driver.findElement(By.id( "ta1"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


click()

The purpose of this command is to click on the required UI element on the web page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager. chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.get( "http://omayo.blogspot.com/");
               driver.manage().window().maximize();
              
               driver.findElement(By. id("alert1")).click();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


id()

The purpose of this command is to intake the id locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.get( "http://omayo.blogspot.com/");
               driver.manage().window().maximize();
              
               driver.findElement(By.id("alert1"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


name()

The purpose of this command is to intake the name locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.get("http://omayo.blogspot.com/");
              driver.manage().window().maximize();
              
              driver.findElement(By.name("q"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


sendKeys()

The purpose of this command is to type text into the text fields and press Keyboard keys. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              
              driver.get( "http://tutorialsninja.com/demo/index.php?route=account/login");
              driver.manage().window().maximize();
              
              driver.findElement(By.id("input-email")).sendKeys("[email protected]");
              
              driver.findElement(By.id("input-password")).sendKeys("Second@123");
              
              driver.findElement(By.id("input-password")).sendKeys(Keys.ENTER);
              
       }

}

For detailed demonstration of this command, you can watch the below video:


className()

The purpose of this command is to intake the class locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get("http://omayo.blogspot.com/");
              
              driver.findElement(By.className("classone"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


linkText()

The purpose of this command is to intake the link text locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get("http://omayo.blogspot.com/");
              
              driver.findElement(By.linkText("compendiumdev"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


cssSelector()

The purpose of this command is to intake the CSS Selector locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               driver.findElement(By.cssSelector("button[value='LogIn']"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


xpath()

The purpose of this command is to intake the XPath locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get("http://omayo.blogspot.com/");
              
              driver.findElement(By.xpath("//button[@value='LogIn']"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


partialLinkText()

The purpose of this command is to intake the partial link text locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get( "http://omayo.blogspot.com/");
              
              driver.findElement(By.partialLinkText("Tutorial"));
              
       }

}

For detailed demonstration of this command, you can watch the below video:


clear()

The purpose of this command is to clear the text from the text fields. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get( "http://omayo.blogspot.com/");
              
              driver.findElement(By.id("textbox1")).clear();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getText()

The purpose of this command is to retrieve the text between the html tags of the required UI element. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get( "http://omayo.blogspot.com/");
              
              String text = driver.findElement(By.id("pah")).getText();
              
              System.out.println(text );
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getTitle()

The purpose of this command is to retrieve the title of the current web page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get( "http://tutorialsninja.com/demo" );
              
              String title = driver.getTitle();
              
              System. out.println(title );
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getCurrentUrl()

The purpose of this command is to retrieve the URL of the current web page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get( "http://tutorialsninja.com/demo");
              
              String url = driver.getCurrentUrl();
              
              System.out.println(url);
              
       }

}

For detailed demonstration of this command, you can watch the below video:


close()

The purpose of this command is to close the current active browser window. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://tutorialsninja.com/demo");
              
               driver.close();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


quit()

The purpose of this command is to close all the browser windows or tabs. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
              driver.manage().window().maximize();
              driver.get( "http://omayo.blogspot.com/");
              
              driver.findElement(By.linkText("Open a popup window")).click();
              
              driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getAttribute()

The purpose of this command is to retrieve the value of the given attribute name from the HTML code of the required UI element. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              String textOnButton = driver.findElement(By.xpath("//input[@class='gsc-search-button'][@type='submit']")).getAttribute("value");
              
              System.out.println(textOnButton );
              
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


isDisplayed()

The purpose of this command is to check whether the given UI element is visible and dispalyed on the web page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
               boolean a = driver.findElement(By.id("but2")).isDisplayed();
               boolean b = driver.findElement(By.id( "hbutton")).isDisplayed();
              System.out.println(a );
              System.out.println(b );
              
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


isEnabled()

The purpose of this command is to check whether the given UI element is in enabled state. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              System.out.println(driver.findElement(By.xpath("//*[@id='but1']")).isEnabled());
              
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


isSelected()

The purpose of this command is to check whether the given UI element (Radio button or checkbox option) is in selected state. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              System.out.println(driver.findElement(By.id("checkbox1")).isSelected());
              
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getScreenshotAs()

The purpose of this command is to take the screenshot. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws IOException {

              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get( "http://omayo.blogspot.com/");
              
              File srcScreenshot = driver.findElement(By.id("hbutton")).getScreenshotAs(OutputType.FILE);
              FileHandler.copy(srcScreenshot, new File(System.getProperty("user.dir")+ "\\screenshots\\screenshot.png"));
              
               driver.quit();

       }

}

For detailed demonstration of this command, you can watch the below video:


getPageSource()

The purpose of this command is to retrieve the HTML Source Code of the current page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException, IOException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://compendiumdev.co.uk/selenium/basic_web_page.html");
              
               //Write code here
              String pageSource = driver.getPageSource();
              System.out.println(pageSource);
             
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


navigate()

The purpose of this command is to navigate to the Application URL, refresh the browser, navigate back and forth in the Browser. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException, IOException {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://www.omayo.blogspot.com/");
              
              Thread. sleep(2000);
              
               //Write code here
               driver.navigate().to("http://compendiumdev.co.uk/selenium/basic_web_page.html");
              
              Thread.sleep(2000);
              
               driver.navigate().refresh();
              
              Thread.sleep(2000);
              
               driver.navigate().back();
              
              Thread.sleep(2000);
              
               driver.navigate().forward();
              
              Thread.sleep(2000);
       
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


submit()

The purpose of this command is to submit the form. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://tutorialsninja.com/demo/index.php?route=account/login");
              
               //Write your code here
               driver.findElement(By.id("input-email")).sendKeys("[email protected]");
              
               driver.findElement(By.id("input-password")).sendKeys("Second@123");
              
              Thread.sleep(3000);
              
               driver.findElement(By.id("input-password")).submit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getTagName()

The purpose of this command is to retreive the tag name in the HTML code of the required UI element. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              String tagName = driver.findElement(By.id("alert1")).getTagName();
              
              System.out.println(tagName);
              
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getSize()

The purpose of this command is to retrieve the height and width of the given UI element. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://tutorialsninja.com/demo/");
              
              Dimension d = driver.findElement(By.name("search")).getSize();
              
              System.out.println("Height of search box field is: "+d .height);
              System.out.println("Width of search box field is: "+d .width);
              
               driver.close();
              

       }

}

For detailed demonstration of this command, you can watch the below video:


getLocation()

The purpose of this command is to retrieve the x and y coordinates of the given UI element. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              Point point = driver.findElement(By.id("ta1")).getLocation();
              
              System.out.println("Height of the text area field is: "+point.x);
              
              System.out.println("Width of the text area field is: "+point.y);
              
               driver.close();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


findElements()

The purpose of this command is to locate multiple UI elements at a time using the given locator. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get( "http://omayo.blogspot.com/");
              
               //Write code here
              List<WebElement> elements = driver.findElements(By.xpath( "//button"));
              
               for(WebElement element : elements) {
                     
                     System.out.println(element.getText());
                     
              }
              
              
               driver.close();
              

       }

}

For detailed demonstration of this command, you can watch the below video:


tagName()

The purpose of this command is to intake the HTML tag and there by helping the findElement(s) commands in locating the UI elements. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get( "http://omayo.blogspot.com/");
              
               //Write code here
               List<WebElement> elements = driver.findElements(By.tagName("button"));
              
               for(WebElement element : elements) {
                     
                     System.out.println(element.getText());
                     
              }
              
               driver.close();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getCSSValue()

The purpose of this command is to retrieve the value of any given CSS Attribute for the given UI element. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              String lineHeight = driver.findElement(By.id("home")).getCssValue("line-height");
              
              System.out.println(lineHeight);
              
               driver.close();
              

       }

}

For detailed demonstration of this command, you can watch the below video:


getClass()

The purpose of this command is to retrive the Class name of the given driver object. The below is the code for using this command:

public class Demo {
       
        public static void main(String[] args) {
              
              WebDriverManager.chromedriver().setup();
               WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              String className = driver.getClass().getSimpleName();
              
              System. out.println(className);
              
               driver.close();

       }

}

For detailed demonstration of this command, you can watch the below video:


getWindowHandle(), getWindowHandles(),switchTo() and window()

The purpose of these command is to switch and handle the windows. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException {
              
              WebDriverManager.chromedriver().setup();
              
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              String firstWindow = driver.getWindowHandle();
              
               driver.findElement(By.linkText("Open a popup window")).click();
              
              Thread.sleep(3000);
              
              Set<String> windows = driver.getWindowHandles();
              
              Iterator<String> itr = windows.iterator();
              
               while(itr.hasNext()) {
                     
                     String window = itr.next();
                     
                      driver.switchTo().window(window);
                     
                      if(driver.getTitle().equals("Basic Web Page Title")) {
                            driver.close();
                     }
                     
              }
              
              
              Thread.sleep(3000);
              
               driver.switchTo().window(firstWindow);
              
               driver.findElement(By.name("q")).sendKeys("Arun");

       }

}

For detailed demonstration of this command, you can watch the below video:


selectByVisibleText()

The purpose of this command is to select an option from the dropdown or multiselection box field using the option displayed text. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException{
              
              WebDriverManager.chromedriver().setup();
              
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write code here
              WebElement dropdownField = driver.findElement(By.id("drop1"));
              Select select = new Select(dropdownField);
               select.selectByVisibleText("doc 3");
              
              WebElement multiSelectionBoxField = driver.findElement(By.id("multiselect1"));
              Select select2 = new Select(multiSelectionBoxField);
               select2.selectByVisibleText("Audi");
       
       }

}

For detailed demonstration of this command, you can watch the below video:


selectByIndex()

The purpose of this command is to select an option from the dropdown or multiselection box field using the index value of the option. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException{
              
              WebDriverManager.chromedriver().setup();
              
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
              Thread.sleep(3000);
              
               //Write code here
              WebElement dropdownField = driver.findElement(By.id("drop1"));
              Select select1 = new Select(dropdownField);
              
               select1.selectByIndex(1);
             
              WebElement multiselectionBoxField = driver.findElement(By.id("multiselect1"));
              Select select2 = new Select(multiselectionBoxField);
              
               select2.selectByIndex(0);
       
       }

}

For detailed demonstration of this command, you can watch the below video:


selectByValue()

The purpose of this command is to select an option from the dropdown or multiselection box field using the value attribute value of the option. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException{
              
              WebDriverManager.chromedriver().setup();
              
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
              Thread. sleep(3000);
              
               //Write code here
              WebElement dropdownField = driver.findElement(By.id( "drop1");
              Select select1 = new Select(dropdownField);
       
               select1.selectByValue( "ghi");
              
              WebElement multiSelectionBoxField = driver.findElement(By.id( "multiselect1"));
              Select select2 = new Select(multiSelectionBoxField );
              
               select2.selectByValue("Hyundaix");
       
       }

}

For detailed demonstration of this command, you can watch the below video:


isMultiple()

The purpose of this command is to check whether multiple options can be selected in from the given UI element. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException{
              
              WebDriverManager.chromedriver().setup();
              
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
              Thread.sleep(3000);
              
               //Write code here
              WebElement dropdownField = driver.findElement(By.id("drop1"));
              Select select = new Select(dropdownField);
              
              System.out.println(select.isMultiple());
       
       }

}

For detailed demonstration of this command, you can watch the below video:


getOptions()

The purpose of this command is to retrieve all the options from the given dropdown or multiselection box feilds. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              WebElement dropdownField = driver.findElement(By.id("drop1"));
              Select select = new Select(dropdownField);
              
              List<WebElement> options = select.getOptions();
              
               for(WebElement option : options) {
                     
                     System.out.println(option.getText());
                     
              }
              
               driver.quit(); 
       }
}

For detailed demonstration of this command, you can watch the below video:


getFirstSelectedOption()

The purpose of this command is to retrive the top most option which is selected in the multiselection box fields. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              WebElement multiselectionBoxField = driver.findElement(By.id("multiselect1"));
              
              Select select = new Select(multiselectionBoxField);
               select.selectByVisibleText("Volvo");
               select.selectByVisibleText("Hyundai");
              
              WebElement element = select.getFirstSelectedOption();
                     
              System.out.println(element.getText());
              
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


getAllSelectedOptions()

The purpose of this command is to retrive all the options which are selected in the multiselection box field. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              WebElement multiSelectionBoxField = driver.findElement(By.id("multiselect1"));
              Select select = new Select(multiSelectionBoxField);
              
               select.selectByVisibleText("Audi");
               select.selectByVisibleText("Volvo");
               select.selectByVisibleText("Hyundai");
       
              List<WebElement> selectedoptions = select.getAllSelectedOptions();
              
               for(WebElement option : selectedoptions) {
                     
                     System.out.println(option.getText());
              }
              
              
               driver.quit();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


deselectByVisibleText()

The purpose of this command is to deselect an option from the multiselection box field using the given visual text of the option. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              WebElement multiSelectionBoxField = driver.findElement(By.id("multiselect1"));
              Select select = new Select(multiSelectionBoxField);
              
               select.selectByVisibleText("Volvo");
               select.selectByVisibleText("Hyundai");
               select.selectByVisibleText("Audi");
              
              Thread.sleep(3000);
              
               select.deselectByVisibleText("Volvo");
              
       }

}

For detailed demonstration of this command, you can watch the below video:


deselectByIndex()

The purpose of this command is to deselect an option from the multiselection box field using the given index value of the option. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              WebElement multiSelectionBoxField = driver.findElement(By.id( "multiselect1"));
              Select select = new Select(multiSelectionBoxField);
              
               select.selectByVisibleText("Volvo");
               select.selectByVisibleText("Swift");
               select.selectByVisibleText("Hyundai");
               select.selectByVisibleText("Audi");
              
              Thread.sleep(3000);
              
               select.deselectByIndex(1);
              
       }

}

For detailed demonstration of this command, you can watch the below video:


deselectByValue()

The purpose of this command is to deselect an option from the multiselection box field using the given html value attribute value of the option . The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              WebElement multiSelectionBoxField = driver.findElement(By.id("multiselect1"));
              Select select = new Select(multiSelectionBoxField);
              
               select.selectByVisibleText("Volvo");
               select.selectByVisibleText("Swift");
               select.selectByVisibleText("Hyundai");
               select.selectByVisibleText("Audi");
              
              Thread. sleep(3000);
              
               select.deselectByValue("Hyundaix");
              
       }

}

For detailed demonstration of this command, you can watch the below video:


deselectAll()

The purpose of this command is to deselect all the options from the multiselection Box field. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               //Write your code here
              WebElement multiSelectionBoxField = driver.findElement(By.id("multiselect1"));
              Select select = new Select(multiSelectionBoxField );
              
               select.selectByVisibleText("Volvo");
               select.selectByVisibleText("Swift");
               select.selectByVisibleText("Hyundai");
               select.selectByVisibleText("Audi");
              
              Thread.sleep(3000);
              
               select.deselectAll();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


frame()

The purpose of this command is to intake the frame details, for switching to the frame with the help of switchTo() Command. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
              WebElement requiredFrame = driver.findElement(By.id("iframe2"));
              
               driver.switchTo().frame(requiredFrame);
              
               driver.findElement(By.linkText("Chapter3")).click();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


parentFrame()

The purpose of this command is to switch to the parent frame of the current frame. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("https://www.w3schools.com/html/tryit.asp?filename=tryhtml_iframe_height_width");
              
               driver.switchTo().frame("iframeResult");
               driver.switchTo().frame(0);
              
              System.out.println(driver.findElement(By.xpath("//h1")).getText());
              
               driver.switchTo().parentFrame();
              
              System.out.println(driver.findElement(By.xpath("//p")).getText());
              
               driver.close();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


defaultContent()

The purpose of this command is switch to the defualt application page with the help of switchTo() Command. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               driver.switchTo().frame("iframe2");
              
               driver.findElement(By.linkText("Chapter2")).click();
              
               driver.switchTo().defaultContent();
              
               driver.findElement(By.name("q")).sendKeys("Arun");
              
       }

}

For detailed demonstration of this command, you can watch the below video:


pageLoadTimeout()

By default selenium waits infinitely for a web page to load before executing the next steps. On using this command, we can fix some timelimit for Selenium for waiting for the web page to load.The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.manage().timeouts().pageLoadTimeout(5,TimeUnit.SECONDS);
               driver.get("https://colabus.com/");
              
       }

}

For detailed demonstration of this command, you can watch the below video:


setScriptTimeout()

The purpose of this command is to globally wait for any independent script on the web page to load. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
              
               driver.manage().timeouts().setScriptTimeout(10,TimeUnit. SECONDS);
                     
               driver.get("http://omayo.blogspot.com/");
       
              
       }

}

For detailed demonstration of this command, you can watch the below video:


implicitlyWait()

The purpose of this command is to globally wait for all the specified UI elements in the Selenium Script for getting displayed and visible on the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
              
               driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
              
               driver.get("http://omayo.blogspot.com/");
              
               driver.findElement(By.className("dropbtn")).click();
              
               driver.findElement(By.linkText("Facebook")).click();
       
       }

}

For detailed demonstration of this command, you can watch the below video:


until() and visibilityOfElementLocated()

The purpose of these commands is to explicitly wait for a specific UI element until its gets visible and displayed on the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
              
              WebDriverWait wait = new WebDriverWait(driver,10);
              
               driver.get("http://omayo.blogspot.com/");
       
               driver.findElement(By.className("dropbtn")).click();
              
              WebElement facebookOption = wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Facebook")));
              
               facebookOption.click();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


elementToBeClickable()

The purpose of this command is to explicitly wait for a specific UI element to get enabled and clickable on the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
              WebDriverWait wait = new WebDriverWait(driver ,15);
              
               driver.findElement(By.xpath("//button[text()='Check this']")).click();
              
               wait.until(ExpectedConditions.elementToBeClickable(By.id("dte")));
              
               driver.findElement(By.id("dte")).click();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


invisibilityOfElementLocated()

The purpose of this command is to explicitly wait for a UI element to get dissapear i.e. get invisible from the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
              WebDriverWait wait = new WebDriverWait(driver,25);
       
               wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("deletesuccess")));
              
               driver.findElement(By.id("alert2")).click();
              
       }

}

For detailed demonstration of this command, you can watch the below video:


alert(), getText(), accept() and dismiss()

The purpose of these command is to:

  • alert() – switch to the displayed alert with the help of switchTo() command
  • getText() – To retrieve the text displayed on the alert
  • accept() – To accept the alert by selecting OK button on the alert
  • dismiss() – To dismiss the alert by escaping the alert

The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
             WebDriverManager.chromedriver().setup();
             WebDriver driver = new ChromeDriver();
             driver.manage().window().maximize();
             driver.get("http://omayo.blogspot.com/");
              
             driver.findElement(By.id("alert1")).click();
              
             Alert alert = driver.switchTo().alert();
              
             String textOnAlert = alert.getText();
       
             System.out.println(textOnAlert);
              
             alert.accept();

             //alert.dismiss();
       
       }

}

For detailed demonstration of this command, you can watch the below video:


alertIsPresent()

The purpose of this command is to explicitly wait for an alert to get displayed on the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
              WebDriverManager.chromedriver().setup();
              WebDriver driver = new ChromeDriver();
               driver.manage().window().maximize();
               driver.get("http://omayo.blogspot.com/");
              
               driver.findElement(By.id("alert1")).click();
              
              WebDriverWait wait = new WebDriverWait(driver,10);
              
               wait.until(ExpectedConditions.alertIsPresent());
              
              Alert alert = driver.switchTo().alert();
              
               alert.accept();

       }

}

For detailed demonstration of this command, you can watch the below video:


sendKeys() of Alert interface

The purpose of this command is type text into the text field that is available on the alert. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.firefoxdriver().setup();
          WebDriver driver = new FirefoxDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/");
         
          driver.findElement(By.id("prompt")).click();
         
          Alert alert = driver.switchTo().alert();
         
          alert.sendKeys("Arun");

       }

}

For detailed demonstration of this command, you can watch the below video:


moveToElement()

The purpose of this command is to simulate mouse cursor by moving it to the specified UI element on the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/");
         
          WebElement blogsMenu = driver.findElement(By.id("blogsmenu"));
         
          Actions actions = new Actions(driver);
        
          actions.moveToElement(blogsMenu).build().perform();
         
       }

}

For detailed demonstration of this command, you can watch the below video:


click() of Actions Class

The purpose of this command is to simulate the mouse click on the specified UI element of the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/");
         
          WebElement alertButton = driver.findElement(By.id("alert1"));
         
          Actions actions = new Actions(driver);
         
          actions.moveToElement(alertButton).click().build().perform();
         
       }

}

For detailed demonstration of this command, you can watch the below video:


dragAndDropBy()

The purpose of this command is to simulate the mouse dragging the specified UI element on the page, either horizontally or vertically based on the specified points. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/p/page3.html");
         
          WebElement minimumPriceOption = driver.findElement(By.xpath("//a[@aria-labelledby='price-min-label']"));
         
          Actions actions = new Actions(driver);
         
          actions.dragAndDropBy( minimumPriceOption, 100, 0).build().perform();
         
       }

}

For detailed demonstration of this command, you can watch the below video:


contextClick()

The purpose of this command is to simulate right clicking of the mouse on the specified UI element of the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com");
         
          WebElement searchBoxField = driver.findElement(By.name("q"));
         
          Actions actions = new Actions(driver);
         
          actions.contextClick(searchBoxField).build().perform();
       
         
       }

}

For detailed demonstration of this command, you can watch the below video:


doubleClick()

The purpose of this command is to simulate double clicking using mouse on the specified UI element of the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com");
         
          WebElement doubleClickOption = driver.findElement(By.id("testdoubleclick"));
         
          Actions actions = new Actions(driver);
         
          actions.doubleClick(doubleClickOption).build().perform();
        
       }

}

For detailed demonstration of this command, you can watch the below video:


dragAndDrop()

The purpose of this command is to simulate mouse dragging the source UI element and dropping it on to the target UI element on the page. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://dhtmlgoodies.com/scripts/drag-drop-custom/demo-drag-drop-3.html");
         
          WebElement osloBox = driver.findElement(By.id("box1"));
          WebElement norwayBox = driver.findElement(By.id("box101"));
        
          Actions actions = new Actions(driver);
          actions.dragAndDrop(osloBox, norwayBox).build().perform();
        
       }

}

For detailed demonstration of this command, you can watch the below video:


keyDown() and keyUp()

The purpose of this command is to:

  • keyDown() – Simulate pressing and holding the Keyboard key
  • keyUp() – Simulate releasing the Keyboard key

. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/");
         
          WebElement compediumDevLink = driver.findElement(By.linkText("compendiumdev"));
         
          Actions actions = new Actions(driver);
         
          actions.moveToElement(compediumDevLink).keyDown(Keys.CONTROL).click().keyUp(Keys.CONTROL).build().perform();
          
       }

}

For detailed demonstration of this command, you can watch the below video:


sendKeys() of Actions Class

The purpose of this command is to press and release the specified Keyboard key. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get( "http://omayo.blogspot.com/");
         
          driver.findElement(By.name("userid")).sendKeys("arun");
         
          Actions actions = new Actions(driver);
         
          actions.sendKeys(Keys.TAB).build().perform();
         
          driver.findElement(By.name("pswrd")).sendKeys("motoori");
         
          actions.sendKeys(Keys.TAB).sendKeys(Keys.ENTER).build().perform();
        
       }

}

For detailed demonstration of this command, you can watch the below video:


chord()

With the help of this command, we can press and release multiple keys together at the same time exaple: Ctrl + Z . The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/");
         
          WebElement usernameField = driver.findElement(By.name("userid"));
         
          usernameField.sendKeys("arun");
         
          Thread.sleep(3000);
         
          usernameField.sendKeys(Keys.chord(Keys.CONTROL,"z"));
         
       }

}

For detailed demonstration of this command, you can watch the below video:


switchTo()

The purpose of this command is to:

  • Switch to the alert when used with alert() command
  • Switch to the frame when used with frame() command
  • Switch to the window when used with window() command

. The below is the code for using this command:

driver.switchTo().alert();
driver.switchTo().frame();
driver.switchTo().window();

For detailed demonstration of this command, you can watch the below video:


build() and perform()

Without specifying these commands at the end of the Actions class commands, they won’t get executed. In case of single command of Actions class, specifying perform() command at the end of the Actions class command will be enough. In case of multiple commands of Actions class to get executed, we need to build and execute them by providing two commands i.e. build() and perform() commads at the end of the Actions class commands. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/");
         
          WebElement searchTextField = driver.findElement(By.name("q"));
         
          searchTextField.sendKeys("Arun");
         
          Actions actions = new Actions(driver);
         
          actions.sendKeys(Keys.TAB).sendKeys(Keys.ENTER).build().perform();
          
       }

}

For detailed demonstration of this command, you can watch the below video:


executeScript()

The purpose of this command is to execute the JavaScript code from the Selenium Automation code. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://omayo.blogspot.com/");
         
          JavascriptExecutor jse = (JavascriptExecutor)driver;
         
          jse.executeScript("alert('Arun Motoori');");
         
       }

}

For detailed demonstration of this command, you can watch the below video:


executeAsyncScript()

The purpose of this command is to execute the Asynchronous JavaScript code from the Selenium Automation code. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get( "http://omayo.blogspot.com/");
         
          JavascriptExecutor jse = (JavascriptExecutor)driver;
         
          jse.executeAsyncScript("window.setTimeout(function(){alert('world');},4000);alert('Hello');");
        
       }

}

For detailed demonstration of this command, you can watch the below video:


getCookies()

The purpose of this command is to retrieve all the cookies that got added to the Browser. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://tutorialsninja.com/demo/");
         
          Set<Cookie> cookies = driver.manage().getCookies();
         
          for(Cookie cookie : cookies ) {
                
                 System.out.println("Cookie Name: " +cookie.getName());
                 System.out.println("Cookie Value: " +cookie.getValue());
                 System.out.println("Cookie Domain: " +cookie.getDomain());
                 System.out.println("Cookie Path: " +cookie.getPath());
                 System.out.println("Cookie Expiry Date: " +cookie.getExpiry());
                 System.out.println("------------------" );
                
          }
         
          driver.close();
         
       }

}

For detailed demonstration of this command, you can watch the below video:


getCookieNamed()

The purpose of this command is to retrieve the cookie from the browser by specifying the name of the cookie. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://tutorialsninja.com/demo/");
         
          Cookie cookie = driver.manage().getCookieNamed("OCSESSID");
         
          System.out.println("Cookie Name: "+cookie .getName());
          System.out.println ("Cookie Value: "+cookie .getValue());
          System.out.println ("Cookie Domain: "+cookie .getDomain());
          System.out.println ("Cookie Path: "+cookie .getPath());
          System.out.println ("Cookie Expiry Date: "+cookie .getExpiry());
         
          driver.close();
          
       }

}

For detailed demonstration of this command, you can watch the below video:


addCookie()

The purpose of this command is to add a new cookie to the Browser apart from the ones that got added by the Application. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://tutorialsninja.com/demo/");
         
          Cookie cookie = new Cookie("arun","motoori");
         
          driver.manage().addCookie(cookie);
       
       }

}

For detailed demonstration of this command, you can watch the below video:


deleteCookieNamed()

The purpose of this command is to delete the cookie from the Browser based on the specified name. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://tutorialsninja.com/demo/");
         
          driver.manage().deleteCookieNamed("OCSESSID");
          
       }

}

For detailed demonstration of this command, you can watch the below video:


deleteCookie()

The purpose of this command is to delete the specified Cookie from the Browser. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://tutorialsninja.com/demo/");
         
          Cookie cookie = driver.manage().getCookieNamed("OCSESSID");
         
          driver.manage().deleteCookie(cookie);
       
       }

}

For detailed demonstration of this command, you can watch the below video:


deleteAllCookies()

The purpose of this command is to delete all  the Cookies from the Browser. The below is the code for using this command:

public class Demo {

        public static void main(String[] args) throws InterruptedException  {
              
          WebDriverManager.chromedriver().setup();
          WebDriver driver = new ChromeDriver();
          driver.manage().window().maximize();
          driver.get("http://tutorialsninja.com/demo/");
         
          driver.manage().deleteAllCookies();

       }

}

For detailed demonstration of this command, you can watch the below video:


I tried my level best in explaining all the Selenium WebDriver commands with example code and video associated with every command. Let me know if you find any command, which is not covered here and you want it to get covered in this article.

Hope you enjoyed this article.

Please provide your valable feedback or post any doubts in the below comments section.


This article is written by Arun Motoori

Comments (4)

Leave a Reply

Your email address will not be published. Required fields are marked *

For FREE Testing Tutorials & Videos

X
Open chat
Contact Us on Whatsapp