How to enter data for authentication required pop up using ruby, page-object and watir-webdriver -
i feel problem has simple solution (although not able find relevant answer through researching). using rubymine ruby 2.0.0 automated testing , using watir-webdriver, 0.6.4, , page-object, 0.9.4 gems.
when ruby opens site testing. before page loads authentication required pop box displayed. says, "the server http://example.com:80 requires username , password. server says: authentication required." not able inspect element, therefore don't know how interact it. have been bypassing issue manually entering username , password.
i think easier fill fields in , click log in rather store cookie, guys know best.
you can pass in authentication credentials via url, bypass dialog. there's example on http://watirwebdriver.com/basic-browser-authentication/:
require 'watir-webdriver' b = watir::browser.start 'http://admin:password@yourwebsite.com' b.goto 'https://admin:password@yourwebsite.com/cart' # replace 'cart' appropriate
Comments
Post a Comment