Interact with ionic popups

Hi,

We have a hybrid app and use ionic popups extensively. What’s the best way to interact with ionic popups or is there a way to do so?

Thanks,
Hardik

Hi @hardik_d,

Our app is a hybrid one, created using Cordova app. The pop ups are assigned an id, using which we can work with them. You can check for any property assigned to these pop ups. Should work the same way I suppose

Thanks,
Sujata

i am trying simply:

@driver.find_element(:xpath, ‘//div[@class=“alert-box”]’).displayed?
@driver.find_element(:id, “alert-button”).click

where first is the alert box and second element “OK” button.

I get no element error for both. Please elaborate “Should work the same way I suppose”

Thanks for replying back

i tried @driver.switch_to.alert and get “An attempt was made to operate on a modal dialog when one was not open.”
i am using 1.3.4 btw

Hi @hardik_d,

I meant that if you inspect the pop ups using chrome inspect tool, there might be properties like id or name using which you can reference.

Else you can try XPATH to work on these pop ups.

Hope I am clear this time :smile:

Thanks,
Sujata

Yeah, i have a hybrid ios app and was having issue on the app. i solved it by using xpath to get to the alert elements by being in native view. couldn’t reach them in webview.