Is it possible to automate hybrid app without enabling WebView Debugging?

@jonahss @SergeyTichomirov I want to automate hybrid app.Every time it is detecting only the NATIVE_APP context.It is not detecting Web View so Is it possible to automate hybrid app without enabling WebView Debugging? or How to enable WebView if i don’t have source code?

APPIUM PHILOSOPHY:You shouldn’t have to recompile your app or modify it in any way in order to automate it.

So how to automate hybrid app with out any modification?

Thanks,
Joshua A

Hi @Yosuva,

This is nothing to do with APPIUM. Appium only works which UIAutomator viewer supports, and By the way this is limitation from UIAutomatior which does not identify elements in webview. If you want to use appium, your developer must rebuild your app with keeping webviewdebugging enable.

Other work around would be use can choose other tools, like Selendroid/Calabash.

Thanks,
Priyank Shah

2 Likes

But Selendroid for android 4.2 and below version devices right?

No, you can use selendroid with all android versions.

@Priyank_Shah is correct. This is a limitation with Android’s underlying automation framework, UIAutomator. You need to enable webview debug in order for us to debug webviews.

can you tell me what are the capabilities required to use selendroid with appium?
If possible please post some same code to automate hybrid app using selendroid.

Thanks,
Joshua

@Priyank_Shah @jonahss @jlipps @SergeyTichomirov Now i am able to automate hybrid app using selendroid without enabling WebView Debugging.But While using selendroid i am not able to increase session Time out and newCommandTimeOut also not working. Appium getting shoutdown after 60 secs.Can any one help me to increase session TimeOut /new command time out to 5 mins?

Can you copy paste what caps you are using?

capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,300); – But i have doubt this will work in selendroid mode.

Please find the capability that i used
dc.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);
dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, “6.0”);
dc.setCapability(MobileCapabilityType.DEVICE_NAME, “Moto G2”);
dc.setCapability(MobileCapabilityType.APP, new File(“D:/user/Training/Android/selendroid/debug/resigned-ed.apk”));
dc.setCapability(“udid”,“ZACFR23SX”);
dc.setCapability(MobileCapabilityType.APP_PACKAGE,“com.package”);
dc.setCapability(MobileCapabilityType.APP_ACTIVITY,“com.SplashScreenActivity”);
dc.setCapability(“newCommandTimeout”,180);

Does not seems anything wrong in caps. Anyway

comment above line in your code and start the server with the command
appium --command-timeout 300

Run the code and check if it works.
Note: this is checked using appium version 1.5.3, which appium version you are using.

Now i am getting this error and not able to execute script also

[MJSONWP] Encountered internal error running command: Error: Unknown exception d
uring instrumentation. Original error android.util.AndroidException: INSTRUMENTA
TION_FAILED:
Now i used appium 1.5.3 .previously i used 1.4.16 in that there is no issue in the script execution