0

I have a hybrid app with redirects on the chrome browser.

In order to make appium recognize both apps, is there a possibility to declare a double desired_cap?

I want to make the script to click on one of the hybrid app button, then after the redirect to chrome is done, a verification of the chrome page should be done (so we can know that the redirect was done correctly) and then we have the driver.back() which will lead us back to the hybrid testing app.

I know is wrong what I've wrote, but can't find the right way.. got the error that the __second__ is not defined.

My example:

enter image description here

Can anyone help me with that? Thanks in advance.

Claudaette
  • 41
  • 1
  • 11

1 Answers1

1

You don't need to change the Desired Capabilities and also it is not possible during the session. You must switch between the context of session (WEB_VIEW or NATIVE): When the chrome opened do this:

driver.switch_to.context['WEB_VIEW_chrome]

Check your verifications and then you can change the context to the Native to continue on your android application:

driver.switch_to.context['NATIVE_APP]

Here is my full answer on this: https://stackoverflow.com/a/62284044/7302505

  • Hi, It seems that the statement has no effect same with the ones from https://stackoverflow.com/questions/62148881/appium-v1-17-1-unable-to-switch-webview-context-in-ios/62284044#62284044 – Claudaette Nov 01 '21 at 09:55