javascript - Unknown Error on Safari history Navigation using Protractor -webdrivers -
i'm trying test history , buttons using muliple browsers test , error gets thrown:
unknownerror: yikes! safari history navigation not work. can go forward or back, once do, can no longer communicate page... (warning: server did not provide stacktrace information) command duration or timeout: 19 milliseconds build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03' system info: host: 'sfm1skf1g3l.local', ip: '10.16.100.172', os.name: 'mac os x', os.arch: 'x86_64', os.version: '10.9.3', java.version: '1.8.0_05' driver info: org.openqa.selenium.safari.safaridriver capabilities [{browsername=safari, takesscreenshot=true, javascriptenabled=true, version=7.0.3, cssselectorsenabled=true, platform=mac, securessl=true}] session id: null
this test works in chrome , firefox not safari:
it("should open find clinic page", function(){ browser.driver.sleep(2000); browser.ignoresynchronization = true; var string = 'clinic'; var main = '.search-large-text'; var link = element(by.csscontainingtext('.submenu li a', string)); expect(link.gettext()).toequal(string); link.click().then(function() { browser.driver.sleep(3000); var title = element(by.csscontainingtext(main, string)); expect(title.gettext()).tobe(string); }); browser.navigate().back().then(function(){ browser.driver.sleep(3000); expect(browser.driver.gettitle()).tobe('target : expect more pay less') }) });
it's pretty obvious workaround, maybe useful future readers:
var prevurl = browser.getcurrenturl(); link.click().then(function() { browser.driver.sleep(3000); var title = element(by.csscontainingtext(main, string)); expect(title.gettext()).tobe(string); }); browser.navigate().to(prevurl).then(function(){ browser.driver.sleep(3000); expect(browser.driver.gettitle()).tobe('target : expect more pay less') });
Comments
Post a Comment