Into Cloud with SauceLabs

If you don’t want to spend your time and resources developing and maintaining your own infrastructure, you can use 3rd party cloud service like BrowserStack or SauceLabs. Both companies made it easy for its customers to run automation against their … Read the rest

Popular Usage of Javascript for Automation

Scroll Element

public static void scrollElementIntoView(WebDriver driver, WebElement element)
{
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript(“arguments[0].scrollIntoView()”, element);
}

public static void scrollToTopOfElement(WebDriver driver, WebElement element)
{
int offset = element.getSize().getHeight() * (-1);
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript(“window.scrollBy(0,” + offset + “)”,

Read the rest

Handle IE the TroubleMaker

Click Issue
IE driver uses native Windows events to perform mouse and keyboard operations, and that result in unexpected behavior.
Get around this issue by turning off nativeEvent when you launch your browser:

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
///…. … Read the rest

Launch Private Browser, With Add-ons, and With Proxy

Launch Browser in incognito or private mode
In chrome use -incognito command line switch in options:

ChromeOptions options = new ChromeOptions(); options.addArguments(“incognito”);
DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(ChromeOptions.CAPABILITY, options);

For Firefox:

FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference(“browser.private.browsing.autostart”,true); For IE:
setCapability(InternetExplorerDriver.IE_SWITCHES, “-private”); … Read the rest

Eye on Browser

We use browser million times a day…But have we ever looked at browser through an automation geek’s thick glasses?

1. What components does a browser have?
Web browsers consist of a user interface, layout engine, rendering engine, JavaScript interpreter, UI … Read the rest

Wait, How Browsers Work?

when we type a URL in the browser, and hit Enter, what happens behind scene?

  • First,the browser will retrieve the file specified by your URL. This html file instructs the browser on extended requirements: images, scripts, external stylesheets etc.
  • Then
Read the rest

WebDriver Rule of Thumb

Rule of Thumb
WebDriver mimics the real world user behavior as closely as possible. Since real world user is not able to interact with any invisible element or elements not rendered yet, neither does webDriver.

So we need to always … Read the rest

Where to find most recent info on WebDriver development?

Since now webdriver development&maintenance are in the hands of browser companies, here are some links that you can get the most recent info on WebDrivers:

For IEDriver and MSEdgeDriver:
https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/tools/webdriver

For Chrome:
https://sites.google.com/a/chromium.org/chromedriver/

Firefox:
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status

Safari:

WebDriver Support in Safari

Read the rest