Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appium 2 - XcuiTest driver args unrecognized wdaLocalPort #16340

Closed
Auto81 opened this issue Jan 16, 2022 · 18 comments · Fixed by appium/appium-xcuitest-driver#1372
Closed

Appium 2 - XcuiTest driver args unrecognized wdaLocalPort #16340

Auto81 opened this issue Jan 16, 2022 · 18 comments · Fixed by appium/appium-xcuitest-driver#1372
Assignees
Labels
Bug a problem that needs fixing

Comments

@Auto81
Copy link

Auto81 commented Jan 16, 2022

The problem

When trying to use appium server --driver-args='{"xcuitest":{"wdaLocalPort": 8104}}' with Appium 2.0.0-beta.23 it throws the following error

appium: error: unrecognized arguments: --driver-args

Environment

  • Appium version (or git revision) that exhibits the issue: Appium 2.0.0-beta.23
  • Last Appium version that did not exhibit the issue (if applicable):Appium 2.0.0-beta.19 (works when i roll back to this version)
  • Desktop OS/version used to run Appium: Appium 2 CLI
  • Node.js version (unless using Appium.app|exe): 14.15.4
  • Npm or Yarn package manager: npm
  • Mobile platform/version under test: ios using xcuitest@3.59.1
  • Real device or emulator/simulator: Sim
@jlipps
Copy link
Member

jlipps commented Jan 17, 2022

--driver-args was abandoned in favour of config schemas. These are provided by driver devs. If you have appium 2 beta and a recent version of the xcuitest driver, you can find the appropriate driver-specific flags in the help:

appium server --help

will produce this as part of the output:

  --driver-xcuitest-webdriveragent-port WEBDRIVERAGENT_PORT
                        Local port used for communication with WebDriverAgent
  --driver-xcuitest-webkit-debug-proxy-port WEBKIT_DEBUG_PROXY_PORT
                        (Real device only) Port to which `ios-webkit-debug-proxy` is connected

So you can simply run:

appium server --driver-xcuitest-webdriveragent-port 8104

@Auto81
Copy link
Author

Auto81 commented Jan 18, 2022

Have updated all device scripts to use '--driver-xcuitest-webdriveragent-port 810x'

When running tests, commands from one test are running on the wrong device sometimes. Looks to be the same behaviour as when I just dont provide 'driver-xcuitest-webdriveragent-port'

From logs it looks like it is just using default port across all devices on the grid

[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100

What else can I provide to help find a fix?

@mykola-mokhnach
Copy link
Collaborator

Could you please provide the full log?

@mykola-mokhnach
Copy link
Collaborator

also make sure the xcuitest driver itself is up to date

@mykola-mokhnach mykola-mokhnach added Needs Info typically non-actionable; needs author to respond NotABug labels Jan 18, 2022
@Auto81
Copy link
Author

Auto81 commented Jan 18, 2022

xcuitest @ 3.59.2
xcode @ 13.2.1
appium @ 2.0.0-beta.24

Below is copy of log when running 1 test with '--driver-xcuitest-webdriveragent-port 8101' set
https://gist.github.com/Auto81/c19e8050869362c0f0d6f4dc337b3b55

Would you expect line 106 to be
'Requesting connection for device XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX on local port 8100'
or
'Requesting connection for device XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX on local port 8101'

@mykola-mokhnach mykola-mokhnach added Bug a problem that needs fixing and removed NotABug Needs Info typically non-actionable; needs author to respond labels Jan 18, 2022
@mykola-mokhnach
Copy link
Collaborator

Thanks. I would expect the provided wda port value to be reflected somewhere in the log, but it is not there. Might be an issue though. @boneskull could you please take a quick look?

@Auto81
Copy link
Author

Auto81 commented Jan 18, 2022

Gist of --show-config, shows that its reading it in

https://gist.github.com/Auto81/4107df8079be2ed21f28aaaa0e754d4d

@mykola-mokhnach
Copy link
Collaborator

I assume there might be an issue while caps are loaded from a json config file. We definitely did not test this case since Grid 4 has been released quite long time ago.

@Auto81
Copy link
Author

Auto81 commented Jan 18, 2022

Still running grid 3 here

@jlipps
Copy link
Member

jlipps commented Jan 18, 2022

Yeah, this all looks correct to me. @boneskull can you see anything related to config that might be off here?

@jlipps
Copy link
Member

jlipps commented Jan 18, 2022

One thing to investigate: the driver creates a new wda instance using this.opts. I forget where we landed on these things, but maybe driver args are not added to this.opts by default? So there would be a code update required in the xcuitest driver to merge the driver arg onto opts, or else make sure it gets passed into the WDA constructor?

@boneskull
Copy link
Contributor

I'll take a look

@boneskull boneskull self-assigned this Jan 18, 2022
@boneskull
Copy link
Contributor

showConfig isn't behaving quite how i'd like either, ugh

@boneskull
Copy link
Contributor

See appium/appium-xcuitest-driver#1372

boneskull added a commit that referenced this issue Jan 19, 2022
`--show-config` was not able to distinguish between defaults and values provided on the CLI.  now it does.  `--show-config` now displays (in this order):

1. any settings from the defaults (across Appium and any extensions)
2. any settings specified in config files
3. any settings specified on the CLI
4. the final merged configuration

Ref: #16340
@jlipps
Copy link
Member

jlipps commented Jan 19, 2022

Since appium/appium-xcuitest-driver#1372 has been merged, within the next day or two a new xcuitest driver should be auto-published, which you can then upgrade to via the CLI to get the fix.

@jlipps
Copy link
Member

jlipps commented Jan 19, 2022

thanks to @boneskull for the fix!

@Auto81
Copy link
Author

Auto81 commented Jan 19, 2022

Since appium/appium-xcuitest-driver#1372 has been merged, within the next day or two a new xcuitest driver should be auto-published, which you can then upgrade to via the CLI to get the fix.

Looks to have been published already :)

Installed and back to parallel glory, thank everyone and @boneskull for fix!

@boneskull
Copy link
Contributor

glad it worked! lol

boneskull added a commit that referenced this issue Jan 19, 2022
`--show-config` was not able to distinguish between defaults and values provided on the CLI.  now it does.  `--show-config` now displays (in this order):

1. any settings from the defaults (across Appium and any extensions)
2. any settings specified in config files
3. any settings specified on the CLI
4. the final merged configuration

Ref: #16340
boneskull added a commit that referenced this issue Jan 19, 2022
`--show-config` was not able to distinguish between defaults and values provided on the CLI.  now it does.  `--show-config` now displays (in this order):

1. any settings from the defaults (across Appium and any extensions)
2. any settings specified in config files
3. any settings specified on the CLI
4. the final merged configuration

Ref: #16340
boneskull added a commit that referenced this issue Jan 19, 2022
`--show-config` was not able to distinguish between defaults and values provided on the CLI.  now it does.  `--show-config` now displays (in this order):

1. any settings from the defaults (across Appium and any extensions)
2. any settings specified in config files
3. any settings specified on the CLI
4. the final merged configuration

Ref: #16340
boneskull added a commit that referenced this issue Jan 19, 2022
`--show-config` was not able to distinguish between defaults and values provided on the CLI.  now it does.  `--show-config` now displays (in this order):

1. any settings from the defaults (across Appium and any extensions)
2. any settings specified in config files
3. any settings specified on the CLI
4. the final merged configuration

Ref: #16340
boneskull added a commit that referenced this issue Jan 20, 2022
`--show-config` was not able to distinguish between defaults and values provided on the CLI.  now it does.  `--show-config` now displays (in this order):

1. any settings from the defaults (across Appium and any extensions)
2. any settings specified in config files
3. any settings specified on the CLI
4. the final merged configuration

Ref: #16340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug a problem that needs fixing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants