Is it possible to set app to background using wdio9 + appium kepler driver?

Hello,

I am wokring on Kepler automation and for now have a question.
Is there a possibility to background the application using JSonRPC and appium kepler driver as for e.g we are doing for Android based platforms:

 await driver.execute('mobile: backgroundApp', { seconds: duration });

Thanks

Hi @Hryhorii_Solonynka

As of this moment, mobile:background is not supported in VegaAppiumDriver.

You can use Simulate HOME button press to do that.
Use the KEY_HOMEPAGE event code to send the app to background:

// Press HOME button to background the app

await driver.execute_script("jsonrpc: injectInputKeyEvent", [{"inputKeyEvent": "170", "holdDuration": 100}]);

// Wait

await driver.pause(duration * 1000);

// Reactivate

await driver.executeScript('mobile: activateApp', { appId: 'com.example.myapp.main' });

Warm regards,
Ivy

Thank you @Ivy_Mahajan.
I will use this aproach for now.

Regards,
Hryhorii

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.