Unable to switch to Alert without closing window popup in webdriver -


scenario:

  1. enter keyword (position) in textbox
  2. press tab or click on next element
  3. a window popup appears
  4. a list of position matching criteria listed
  5. click required record
  6. popup window closes automatically
  7. alert displayed
  8. have click on ok button of alert.
  9. switch main window , check position details

question :- found many solutions in site performing actions on window popup , close popup switch alert or main browser

but application closes popup window automatically after selection,hence cannot use driver.close() or driver.switchto.defaultcontent().

if dont close driver (for popup) im not able identify next alert displayed after popup.

if switch directly mainwindhandle, alert dismiss happening instead of accept.

please know how switch window popup alert without popup close needed...

thanks ....

  1. if alert dismiss happening when trying accept it, why don't use alert.dismiss(), accept alert in context.

  2. when switch popup window, driver focus on popup window. might want is, after clicking required record, switch main window accept alert.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -