waitForAppScript passed as string but appium doesn't create new session

Hello, I keep getting the following error using appium 1.5 released last week:

[debug] [Appium] Capability ‘waitForAppScript’ changed from string to boolean. This may cause unexpected behavior
[BaseDriver] SessionNotCreatedError: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): waitForAppScript must be of type string.

My dcaps in appium logs:

[Appium] Capabilities:
[Appium] udid: ‘—’
[Appium] platformName: ‘iOS’
[Appium] platformVersion: ‘8.3’
[Appium] deviceName: ‘—’
[Appium] sendKeyStrategy: ‘grouped’
[Appium] autoAcceptAlerts: false
[Appium] waitForAppScript: ‘true’
[Appium] app: ‘—’
[Appium] newCommandTimeout: 180

my dcaps in code:

    caps: {
        udid: $udid,
        platformName: 'iOS',
        platformVersion: @version,
        deviceName: @name,
        sendKeyStrategy: 'grouped',
        autoAcceptAlerts: $property['autoAcceptAlerts'],
        waitForAppScript: 'true',
        app: @app,
        newCommandTimeout: 180
    }

I’ve tried a couple of different combinations of true True ‘true’ ‘True’ “true” “True”

all with same results.

The info on the error seems strange also it says “Capability ‘waitForAppScript’ changed from string to boolean.” but then the error message itself says the opposite. “Details: The desiredCapabilities object was not valid for the following reason(s): waitForAppScript must be of type string.”

Is anyone else facing the same issue?

Your might have code that is converting all input from your caps to string. We have our capabilities stored in a yaml file and we do some post processing to convert integer values to integers, and boolean values to booleans.

What happens if you run without that capability? Why do you think you need it, and what exactly does it do for you?

I’ll give that a shot

I have the same issue. I works with 1.5 without that capability and breaks with it:
[SessionNotCreatedError: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): waitForAppScript must be of type string.]

I need this capability because the app i’m testing starts with a notification dialog which I want to dismiss, but can’t right now.

Willosser:

No luck.

wreed:

The tests will run, but it errors out like joustie said. I install the app using code, and not appium. This cap basically waits for the app to be launched before it tries to run any scripts.

joustie:

I am setting some time aside this week to try and debug this and figure it out. I’ll let you know if I find an answer, please let me know if you do as well.

Thanks all.

@Ed_Campos @joustie This sounds like a bug to me. Thanks for giving it a try. I would advise before you debug the issue that you file a bug on GitHub and post any debug info there. You can post the link to the bug here so that others can find it if you’d like.

I also have this issue and just find that a semicolon needs to be put at the end like “true;”. Try if it resolves your issue.

1 Like

Adding a semicolon also works for me!

Hi All,

Sorry for the delay. Thanks for the suggestion. That also worked for me. A colon also works.

@dcapability = {
    caps: {
        udid: $udid,
        platformName: 'iOS',
        platformVersion: @version,
        deviceName: @name,
        sendKeyStrategy: 'grouped',
        autoAcceptAlerts: $property['autoAcceptAlerts'],
        waitForAppScript: "true,",
        app: @app,
        newCommandTimeout: 180
    }

Seems like a bug. I’ll file something with appium.

Thanks! Whoever is a mod can close this.