Common tricks

  • 08
    Jan

    Handle non-trusted connection in Selenium WebDriver

    A trusted SSL certificate helps to validate the authenticity of the website. In case it doesn’t, you will get an error message from your browser for “non-trusted connection”.  An Untrusted...

    Read More
  • 01
    Jan

    Waits in Selenium – Implicit, Explicit, Fluent wait & Thread.sleep

    Explicit wait in selenium: Forcing an exact time of wait (Explicit wait) for specific time can be achieved with:   WebDriverWait wait; wait = new WebDriverWait(driver, 30); wait.until(ExpectedConditions.visibilityOf(lnkCardMenu)); This...

    Read More
  • 04
    Oct

    Switching between tabs in Selenium

    Switching between tabs in Selenium   //Get handle to Current window tab. String mainWindowHandle = driver.getWindowHandle(); //Perform action which opens a new tab window in browser. //Get the list...

    Read More
  • 04
    Oct

    Switching between windows during script run

    String winHandleBefore = driver.getWindowHandle(); // Perform GUI action which opens a new window, use following code to switch to pop-up window: for (String currentWindow : driver.getWindowHandles()) driver.switchTo().window(currentWindow); to revert...

    Read More
  • 04
    Oct

    Double click in Selenium

    Perform Double click in Selenium Selenium provides Actions class to allow end user perform double click on an object. Actions act = new Actions(driver); act.moveToElement(driver.findElement(By.xpath(“Element“))).doubleClick().build().perform();

    Read More