Browser Basics

Onno Steenbergen edited this page May 7, 2015 · 1 revision

Overview

The LL Browser is an extension on the Watir Browser class. Any functions that LL Browser doesn't implement will be forwarded to Watir in the background.

Creating a browser

LL will open a browser window according the the configuration file whenever you try to use browser. This window will be managed by LL and all features below are supported.

To create a second window or even a different browser you can easily create a new Watir::Browser instance with:

second_browser = browser.create :chrome

Both the LL browser window and the other browsers support arguments.

browser :firefox, :profile => 'default'

As the LL browser is only initialized once, the arguments must be passed before using the browser. A suggestion is doing it in the env.rb directly after adding to the World object.

Restarting

Restarting the LL browser will close and open the browser with the same settings the original had.

browser.restart

Closing the browser

Both close and quit work.

browser.close

Navigation

browser.goto "http://www.spritecloud.com"

Remote testing

Lapis Lazuli supports Selenium grids out of the box:

browser :remote, {
  :url => "http://hub.browserstack.com/wd/hub/"
  :user => "USERNAME",
  :password => "PASSWORD_OR_APIKEY",
  :caps => {
    "browser" => "Firefox",
    "browser_version" => "34.0",
    "os" => "OS X",
    "os_version" => "Yosemite",
    "resolution" => "1024x768"
  }
}

If the configuration includes a remote settings object you can omit the settings.

A browser can override the configuration settings. The browser in the following example will have the same :url, :user, and :password but different :caps. Capabilities are not merged, so resolution will not be set

browser.create :remote, :caps => {
  "browser" => "IE",
  "browser_version" => "9",
  "os" => "Windows",
  "os_version" => "7",
}

Further Reading

All other functionality of the Browser class is either inherited from the Watir browser, or documented in one of the BrowserModule sections.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.