Method: Protractor#setLocation

Defined in:
lib/angular_webdriver/protractor/protractor.rb

#setLocation(url) ⇒ Object

Browse to another page using in-page navigation.

Assumes that the page being loaded uses Angular.

@example
browser.get('http://angular.github.io/protractor/#/tutorial');
browser.setLocation('api');
expect(browser.getCurrentUrl())
    .toBe('http://angular.github.io/protractor/#/api');

@param url [String] In page URL using the same syntax as $location.url()


210
211
212
213
214
215
216
217
218
219
# File 'lib/angular_webdriver/protractor/protractor.rb', line 210

def setLocation url
  waitForAngular

  begin
    executeScript_(client_side_scripts.set_location,
                   'Protractor.setLocation()', root_element, url)
  rescue Exception => e
    raise e.class, "Error while navigating to '#{url}' : #{e}"
  end
end