appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
18.74k stars 6.06k forks source link

RESOLVED - iOS processArguments doesn't send arguments to the application #6620

Closed JakeSc closed 8 years ago

JakeSc commented 8 years ago

The problem

According to http://appium.io/slate/en/master , the processArguments capability is used for "Arguments to pass to the AUT using instruments". However, setting the capability processArguments actually causes environment variables to be set in the subsequent instruments command, not process arguments.

Testing with this (Java):

capabilities.setCapability("processArguments", "-arg -arg2 -arg3");

incorrectly causes the instruments command to look like this:

[debug] [Instruments] Spawning instruments with command: 'instruments -t Automation.tracetemplate -w "iPhone 6s (9.3) [" /path/to/App.app.app -e -arg "-arg2 -arg3" ...

(Note the -e -arg "-arg2 -arg3".)

According to man instruments, -e is used to set environment variables. Process arguments should simply be passed in as additional arguments to the instruments command, like:

[debug] [Instruments] Spawning instruments with command: 'instruments -t Automation.tracetemplate -w "iPhone 6s (9.3) [" /path/to/App.app.app -arg -arg2 -arg3 ...

Environment

See logs here Search for "Spawning instruments with command" and you'll see the bug.

Code To Reproduce Issue [ Good To Have ]

        DesiredCapabilities capabilities = new DesiredCapabilities();

            capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6s");
            capabilities.setCapability(MobileCapabilityType.APP, "/DerivedData/MyApp-asdffxpdxxuyuvbwslojebjfqxcf/Build/Products/Debug-iphonesimulator/MyApp.app");
            capabilities.setCapability("processArguments", "-asdf -asdf2 -asdf3");
            UiTestcase.driver = new IOSDriver<MobileElement>(new URL("http://localhost:4723/wd/hub"), capabilities);
JakeSc commented 8 years ago

Never mind, this was resolved by this commit:

50f0c822ccf589996145c7e3473c44e01b78145c
Allow plain text process arguments

Closing.

JakeSc commented 8 years ago

This should be closed. Thanks!

SrinivasanTarget commented 8 years ago

@triager please close

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.