selenium - Seleium/Ruby - NoSuchElement when trying to access an item in a modal popup -
what i'm attempting:
click on profile picture of user created: http://screencast.com/t/ajcfi3xa
click on , make selection drop down in pop modal: http://screencast.com/t/ahgohlg05
the selenium ide
picks steps as:
- click >
id=patientphoto
- selectwindow >
name=modal3
(note modal number changes , increases exponentially, if run these steps again next time around it's modal4) - click >
id=ext-gen115
click >//div[@id='ext-gen179']/div[2]
this playback in ide works without issue.
my code:
@driver.find_element(:id, "patientphoto").click wait_for { displayed?(:id, "ext-gen31") } @driver.find_element(:id, "ext-gen31").click @driver.find_element(:xpath, "//div[@id='ext-gen179']/div[2]").click
in other places/workflows have switch default content switch frame trick:
@driver.switch_to.default_content @driver.switch_to.frame('chartframe')
but no combination of working here.
other things i've tried:
1. switch last window this: @driver.switch_to.window(@driver.window_handles.last) # doesn't fail step after (finding drop down) fails 2. @driver.switch_to.frame('modal4') attempt access items in modal # fails think because modal number keeps changing
here's page coding - http://screencast.com/t/osiigjxdblk
the selenium
errors vary based on i'm attempting it's either timeout or cannot find element.
if there iframe
dynamic id
, try use following line of code switch it:
@driver.switch_to.frame(@driver.find_element(:xpath, "//iframe[contains(@id, 'modal')]"))
Comments
Post a Comment