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

(WDIO) browser.getPageSource() does not work with Appium 1.19.0+ on iOS simulator for pages containing Date Picker #14915

Closed
wenzhhu opened this issue Nov 26, 2020 · 5 comments
Labels
ThirdParty upstream problems XCUITest regarding xcuitest driver

Comments

@wenzhhu
Copy link

wenzhhu commented Nov 26, 2020

The problem

(WDIO) browser.getPageSource() does not work with Appium 1.19.0+ on iOS simulator for pages containing Date Picker.

From the wdio_appium.log., the page source is not returned back until Appium decides to delete the session, which is too later.

Environment

  • Appium version (or git revision) that exhibits the issue:
    appium --version
    1.19.0+
  • Last Appium version that did not exhibit the issue (if applicable):
    1.18.3
  • Desktop OS/version used to run Appium:
    macOS Big Sur 11.0.1
  • Node.js version (unless using Appium.app|exe):
    v10.21.0
  • Npm or Yarn package manager:
    npm --version
    6.14.4
  • Mobile platform/version under test:
    iPhone 11 (iOS 13.3) / XCode 12.0.1
  • Real device or emulator/simulator:
    iOS simulator (with XCUITest)
  • Appium CLI or Appium.app|exe:
    Appium CLI (wrapped in WDIO)

Details

20:03:08 [0-0] 2020-11-26T07:02:50.219Z INFO webdriver: COMMAND getPageSource()
20:03:08 [0-0] 2020-11-26T07:02:50.219Z INFO webdriver: [GET] http://localhost:4833/session/474c7c12-83f3-4a2b-b66c-f4a3db394796/source
20:04:15 [0-0] 2020-11-26T07:03:50.241Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded

Link to Appium logs

wdio_appium.log (partially)

2020-11-27 10:52:38:376 - [debug] �[35m[W3C (be183117)]�[39m Calling AppiumDriver.getPageSource() with args: ["be183117-4d0c-486e-8359-8d31e6e036a1"]
2020-11-27 10:52:38:376 - [debug] �[35m[XCUITest]�[39m Executing command 'getPageSource'
2020-11-27 10:52:38:377 - [debug] �[35m[WD Proxy]�[39m Matched '/source' to command name 'getPageSource'
2020-11-27 10:52:38:378 - [debug] �[35m[WD Proxy]�[39m Proxying [GET /source] to [GET http://127.0.0.1:8200/session/0A02FD16-DECB-46DE-8372-9B716AF10DDF/source] with no body
2020-11-27 10:54:08:324 - �[35m[HTTP]�[39m �[37m-->�[39m �[37mDELETE�[39m �[37m/session/be183117-4d0c-486e-8359-8d31e6e036a1�[39m
2020-11-27 10:54:08:324 - �[35m[HTTP]�[39m �[90m{}�[39m
2020-11-27 10:54:08:324 - [debug] �[35m[W3C (be183117)]�[39m Calling AppiumDriver.deleteSession() with args: ["be183117-4d0c-486e-8359-8d31e6e036a1"]
2020-11-27 10:54:08:325 - [debug] �[35m[BaseDriver]�[39m Event 'quitSessionRequested' logged at 1606427648325 (10:54:08 GMT+1300 (New Zealand Daylight Time))
2020-11-27 10:54:08:325 - �[35m[Appium]�[39m Removing session be183117-4d0c-486e-8359-8d31e6e036a1 from our master session list
2020-11-27 10:54:08:326 - [debug] �[35m[WD Proxy]�[39m Matched '/session/be183117-4d0c-486e-8359-8d31e6e036a1' to command name 'deleteSession'
2020-11-27 10:54:08:326 - [debug] �[35m[WD Proxy]�[39m Proxying [DELETE /session/be183117-4d0c-486e-8359-8d31e6e036a1] to [DELETE http://127.0.0.1:8200/session/0A02FD16-DECB-46DE-8372-9B716AF10DDF] with no body
2020-11-27 10:54:38:384 - �[35m[HTTP]�[39m �[37m<-- GET /session/be183117-4d0c-486e-8359-8d31e6e036a1/source �[39m�[32m-�[39m �[90m- ms - -�[39m
2020-11-27 10:54:38:384 - �[35m[HTTP]�[39m �[90m�[39m
2020-11-27 10:55:47:740 - [debug] �[35m[WD Proxy]�[39m Got response with status 200: {"value":"\n<XCUIElementTypeApplication type

Create a GIST which is a paste of your full Appium logs, and link them here.
Do NOT paste your full Appium logs here, as it will make this issue very long and hard to read!
If you are reporting a bug, always include Appium logs!

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.

Please git clone https://github.com/appium/appium and from the sample-code directory, use one of your favourite languages and sample apps to reproduce the issue.

In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.

@mykola-mokhnach
Copy link
Collaborator

Please provide the full server log along with device logs

@mykola-mokhnach mykola-mokhnach added the Needs Info typically non-actionable; needs author to respond label Nov 26, 2020
@wenzhhu wenzhhu changed the title (WDIO) browser.getPageSource() does not work with Appium 1.19.0.beta on iOS simulator (WDIO) browser.getPageSource() does not work with Appium 1.19.0 on iOS simulator Nov 26, 2020
@wenzhhu wenzhhu changed the title (WDIO) browser.getPageSource() does not work with Appium 1.19.0 on iOS simulator (WDIO) browser.getPageSource() does not work with Appium 1.19.0+ on iOS simulator for pages containing Date Picker Nov 27, 2020
@wenzhhu
Copy link
Author

wenzhhu commented Nov 27, 2020

updated with the most important part of wdio_appium.log.

Will try with a sample app which contains Date Picker only next week if needed. Thanks. @mykola-mokhnach

@mykola-mokhnach
Copy link
Collaborator

Unfortunately there is nothing on appium side we could do about it. The page source is retrieved by XCTest, so the original issue must be reported to Apple.

As a possible workaround you could try to use appium@beta and also check similar issue reports, for example #13595

Closed as third party issue

@mykola-mokhnach mykola-mokhnach added ThirdParty upstream problems XCUITest regarding xcuitest driver and removed Needs Info typically non-actionable; needs author to respond labels Nov 27, 2020
@wenzhhu
Copy link
Author

wenzhhu commented Nov 30, 2020

Just wondering how this could be a XCTest issue given the only thing changed is Appium version?

Does this imply there's a "wrong workaround" in Appium 1.18 but now in 1.19 the decision is to remove this workaround so the XCTest issue is exposed?

@KazuCocoa
Copy link
Member

Potentially, yes.
Appium 1.19 had some optimization/cleanup in snapshot lookup. Current appium@beta (which will be 1.20.0) also has some cleanup/removal WDA own implementation with calling XCTest APIs more. Thus, potentially such cases could happen.

snapshotMaxDepth or snapshotTimeout(customSnapshotTimeout) could help http://appium.io/docs/en/advanced-concepts/settings/index.html if it was nested element retrival stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ThirdParty upstream problems XCUITest regarding xcuitest driver
Projects
None yet
Development

No branches or pull requests

3 participants