Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upBrowser Basics
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 :chromeBoth 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.restartClosing the browser
Both close and quit work.
browser.closeNavigation
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.