c# - Handling popups to pass details Selenium -


enter image description herei trying pass details of user, when popup shows up. details include first name, last name, emailid etc. know how send keys popup not in different boxes(like need enter last name press tab, go second name). trying inspect element css code, not html code. c# code have written is:

var w = new webdriverwait(driver.instance, timespan.fromseconds(20)); var copy = w.until(expectedconditions.elementisvisible(by.id("copybutton"))); copy.click(); ialert alert = wait.until(expectedconditions.alertispresent()); 

i have no idea how proceed. can please help? thank you.

you shoul try below :-

 string mainwindow = driver.windowhandle;  var w = new webdriverwait(driver.instance, timespan.fromseconds(20)); var copy = w.until(expectedconditions.elementisvisible(by.id("copybutton"))); copy.click(); driver.switchto().window(driver.windowhandles.last());  //do stuff filling form in popup window  //then close popup window  driver.close();   //switch main window driver.switchto().window(mainwindow);   // stuff main window 

hope helps..:)


Comments