Selenium

  • 26
    Jun

    select drop down value by visible text / index value

    public static void selectDropDownByVisibleText(WebElement webElement, String visibleText) { Select dropdown = new Select(webElement); if(visibleText ==null ||visibleText.isEmpty()){ return; } dropdown.selectByVisibleText(visibleText); System.out.println(“Value selected:{} “, visibleText); } ======================================================= public static void selectDropDownByIndex(MCWebElement...

    Read More
  • 26
    Jun

    Register nodes with Selenium grid

    Register hub: Step 1. Navigate to standalone server jars folder and enter following command: java -jar selenium-server-standalone-3.12.0.jar -port 4444 -role hub note down following lines (from output of above...

    Read More
  • 26
    Jun

    check if a checkbox is checked in selenium webdriver

    package SeleniumPractice; import java.text.ParseException; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; import org.testng.Assert; import org.testng.annotations.Test; public class AddCookiesInSelenium { WebDriver driver; @Test...

    Read More
  • 26
    Jun

    scroll a long web page in selenium webdriver

    package SeleniumPractice; import java.text.ParseException; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; import org.testng.Assert; import org.testng.annotations.Test; public class AddCookiesInSelenium { WebDriver driver; @Test...

    Read More
  • 26
    Jun

    drag and drop with selenium webdriver

    package SeleniumPractice; import java.text.ParseException; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; import org.testng.Assert; import org.testng.annotations.Test; public class DragAndDropInSelenium { WebDriver driver; @Test public void...

    Read More
  • 26
    Jun

    working with menus in Selenium (mouseover and click on link)

    package SeleniumPractice; import java.text.ParseException; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; import org.testng.annotations.Test; public class Workingwithmenus { WebDriver driver; @Test public void enterText() throws InterruptedException, ParseException...

    Read More
  • 26
    Jun

    add custom cookie with selenium webdriver

    package SeleniumPractice; import java.text.ParseException; import java.util.Set; import java.util.concurrent.TimeUnit; import org.openqa.selenium.Cookie; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.Test; public class AddCookiesInSelenium { WebDriver driver; @Test public void enterText() throws InterruptedException, ParseException...

    Read More
  • 26
    Jun

    Multithreaded initializing of browsers with Selenium web driver

    Internet Explorer Driver InternetExplorerDriver is a standalone server which implements WebDriver’s wire protocol. This driver has been tested with IE 7, 8, 9, 10, and 11 on appropriate combinations...

    Read More
  • 09
    Jan

    Initializing iOS or Android drivers

    public static Appiumdriver driver; AppiumServiceBuilder serviceBuilder = new AppiumServiceBuilder().usingAnyFreePort(); service=AppiumDriverLocalService.buildService(serviceBuilder); service.start(); driver = (isTargetAndroid()) ? getAndroidDriver(service.getUrl(), false, false) : getIOSDriver(service.getUrl(), false, false); where isTargetAndroid() is a private method in...

    Read More
  • 09
    Jan

    Selenium drivers for Mobile automation

    RemoteWebDriver: This driver class comes directly from the upstream Selenium project. This is a pretty generic driver where initializing the driver means making network requests to a Selenium hub...

    Read More