July 2017
Intermediate to advanced
384 pages
8h 23m
English
The browser object is a globally created wrapper around an instance of WebDriver. It is used for navigation and page-wide information. With browser.get(), you can navigate to a page and then check the page's title as follows:
describe('Google page', function() { it('should have a title', function() { browser.get('https://www.google.com'); expect(browser.getTitle()).toEqual('Google'); });});
The current URL is returned by browser.getCurrentUrl(). For example:
expect(browser.getCurrentUrl()).toContain('/admin');
Other global objects created by Protractor are element and by. element is a helper function for finding DOM elements on the page you are testing. It requires one parameter--a locator for locating ...
Read now
Unlock full access