ruby on rails - While launching browser how to handle authentication pop up in Rspec -
the website testing requires user login, , handled webserver not html form, generates authentication popup in browser.
i've tried doing following
before(:each) $browser = watir::browser.new :firefox $browser.driver.manage.window.maximize $browser.goto('http://qa.outbidhq.com') popup = rautomation::window.new(:title => /authentication/i) popup.send_keys('xxxxxx') # user id popup.send_keys :tab popup.send_keys('yyyyyyyyy') # password popup.send_keys :tab popup.send_keys :enter sleep(15) end
but code not working........ while launching browser need handle window pop user name , password.....any suggestion?????? new rspec ...using ruby
rautomation library provides ui automation using api similar watir. understands concepts of things text fields, buttons etc. can @ rdoc, or thing find helpful when learning new code library @ tests
since ui bit interacting simple, can reference things index.
i recommend experimenting bit using irb, it's best way try things , see happens can more examine window , experiment 1 line of code @ time see happens. odds end (untested, i'm guessing cancel button index 0 , login button index 1)
popup = rautomation::window.new(:title => /authentication/i) popup.text_field(:index => 0).set('xxxxxx') # user id popup.text_field(:index => 1).set('yyyyyyyyy') # password popup.button(:index => 1).click
Comments
Post a Comment