Method is not implemented for runIOSAppInBackgroundAndWait

Hey guys,

I have a problem with (most likely) correctly setting up katalon studio on mac os Mojave 10.14.4
Katalon Studio 6.1.2
appium@1.8.2-beta

I am trying to run a test case for my iOS app. I need to click on a system dialogue, after which appium doesnt refresh elements on a page, so I found a workaround with putting the app into a background for a set time.

Katalon has a function for this - Mobile.runIOSAppInBackgroundAndWait() . But when I use this, the test case fails with:

c.k.k.core.keyword.internal.KeywordMain - :x: Cannot run iOS app in background (Root cause: org.openqa.selenium.WebDriverException: Method is not implemented (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘dominiks-mbp.home’, ip: ‘fe80:0:0:0:1864:17ae:c553:4acb%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.4’, java.version: ‘1.8.0_181’

Driver info: io.appium.java_client.ios.IOSDriver

Capabilities {app: /xxxx…, automationName: XCUITest, browserName: , databaseEnabled: false, deviceName: iPhone 7 Plus, fullReset: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, newCommandTimeout: 1800, noReset: false, platform: IOS, platformName: IOS, platformVersion: 12.2, realDeviceLogger: /Applications/Katalon Studi…, takesScreenshot: true, udid: FCCC6E1F-8C48-48E3-839B-6AE…, waitForAppScript: true;, wdaLocalPort: 63892, webStorageEnabled: false}

Session ID: 74fdeece-deca-482c-86f6-61bf73d351f4

at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)

When I try cmd+shift+m for autoimports in my Script view, I get another error:

This is my settings regarding buildpath:

This is my JRE settings:

So everything seems to be default settings, yet I still cant call this function for some reason, neither use autoimports

Any ideas?

Hi @dominik.pokora,

Please try this workaround:

import java.time.Duration

import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory

import io.appium.java_client.AppiumDriver
import io.appium.java_client.ios.IOSDriver

IOSDriver<?> driver = MobileDriverFactory.getDriver()

driver.runAppInBackground(Duration.ofSeconds(10))

We will fix this issue in v6.2 or later.

Thanks

Hello,

Thanks for answer. It does not solve my issue though:

First of all I cant use autoimport… so after googling a bit I found this: Can we use Mobile Driver Factory(like web driver factory) and how to implement it to know what imports to use.

But the “runAppInBackground” function still fails:

Test Cases/TakeScreenshots FAILED.

Reason:

groovy.lang.MissingPropertyException: No such property: Duration for class: Script1555793259667

at TakeScreenshots.run(TakeScreenshots:31)

at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)

It looks like its still not imported properly:

And when I try to use cmd+shift+m for autoimport I get:

Hi @dominik.pokora,

Please use import java.time.Duration

import java.time.Duration

import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory

import io.appium.java_client.AppiumDriver
import io.appium.java_client.ios.IOSDriver

IOSDriver<?> driver = MobileDriverFactory.getDriver()

driver.runAppInBackground(Duration.ofSeconds(10))

Hello,

that works, thank you very much.

I really hope that the autoimports be fixed in the stable release of Katalon 6.2, its very helpful feature

Thanks,

Dominik