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 the element. Locators are created using the by object. There is a range of locators. We will only mention a few of them. For a full list, read the official API documentation (http://www...