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

Not able to call 'setSetting' API #1310

Closed
jineshqa opened this issue Mar 3, 2020 · 21 comments
Closed

Not able to call 'setSetting' API #1310

jineshqa opened this issue Mar 3, 2020 · 21 comments

Comments

@jineshqa
Copy link

jineshqa commented Mar 3, 2020

facebookarchive/WebDriverAgent#1074

The problem

Appium fails to fetch snapshot. I think it might be related to above issue.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.15.1
  • Last Appium version that did not exhibit the issue (if applicable): NA
  • Desktop OS/version used to run Appium: Mojave 10.14.6
  • Node.js version (unless using Appium.app|exe): Using .app
  • Npm or Yarn package manager:
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: Simulator
  • Appium CLI or Appium.app|exe: .app

Details

Appium fails to take snapshot with error
2020-03-03 15:49:52.959309-0800 WebDriverAgentRunner-Runner[13001:2373474] Cannot take the snapshot of Window after 15 seconds
2020-03-03 15:49:52.959665-0800 WebDriverAgentRunner-Runner[13001:2373474] Internal error: Error Domain=com.apple.dt.xctest.automation-support.error Code=5 "Error kAXErrorIPCTimeout getting snapshot for element <AXUIElementRef 0x7fdc83546d80> {pid=12189} {uid=[ID:9999 hash:0xe948db3f07000000]}" UserInfo={NSLocalizedDescription=Error kAXErrorIPCTimeout getting snapshot for element <AXUIElementRef 0x7fdc83546d80> {pid=12189} {uid=[ID:9999 hash:0xe948db3f07000000]}}
2020-03-03 15:49:52.961785-0800 WebDriverAgentRunner-Runner[13001:2373474] Skipping source dump for 'Window' because its snapshot cannot be resolved

Link to Appium logs

https://gist.github.com/jineshqa/de4aa49bd17008ed397dc5fb3821079c

Code To Reproduce Issue [ Good To Have ]

Not reproducible with sample app.

@KazuCocoa
Copy link
Member

thanks

The error looks coming from XCTest framework internal. I don't think we can fix it in Appium side since Appium gets data by XCTest framework.

You could try snapshotTimeout in https://appium.io/docs/en/advanced-concepts/settings/ if the cause was timeout to get the snapshot.

@jineshqa
Copy link
Author

jineshqa commented Mar 4, 2020

@KazuCocoa Something like this?

resultCaps.setCapability("settings[snapshotTimeout]", 60);

@jineshqa
Copy link
Author

jineshqa commented Mar 4, 2020

@KazuCocoa Where and how do I update these settings?
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/settings.md

Are these to be set when running appium server or can be set via code?

Thanks

@KazuCocoa
Copy link
Member

Like https://github.com/appium/appium/blob/master/docs/en/commands/session/settings/update-settings.md linked in the settings.md or via capabilities like you commented settings[settingsKey https://appium.io/docs/en/writing-running-appium/caps/

@jineshqa
Copy link
Author

jineshqa commented Mar 4, 2020

What is the minimum version of java_client where this is supported? What should I import?

driver.setSetting is showing error in my IDE.

Thanks

@KazuCocoa
Copy link
Member

I don't know Java client, but maybe the latest one has...

@jineshqa
Copy link
Author

jineshqa commented Mar 4, 2020

I tried latest one as well (7.3.0), I am still getting the error setSetting not found.

@KazuCocoa
Copy link
Member

What about providing the setting via capabilities as you addressed in https://github.com/appium/appium/issues/14022#issuecomment-594254144 ?
They work the same. If it did not help your case, Appium cannot do anything for the XCTest internal error, unfortunately

@mykola-mokhnach mykola-mokhnach transferred this issue from appium/appium Mar 4, 2020
@jineshqa
Copy link
Author

jineshqa commented Mar 4, 2020

@KazuCocoa Even if that works it will set for entire session and I do not want that as test execution time will increase exponentially.

This is not XCTest issue, this works fine with XCUITest from Xcode. This issue is because WDA is slow on pages with 400+ links, which can be worked around using the settings mentioned but java_client is not letting me use setSetting method. So this is java_client issue. If java_client works and WDA does not respond to it them it becomes WDA issue.

@KazuCocoa
Copy link
Member

Okay, so this issue is cannot call setSetting API. Renaming,

hm, Java client seems to have the API
https://github.com/appium/java-client/search?q=setSetting&unscoped_q=setSetting

By Settings API was improved to accept string names. #1240, the key accepts String.

@KazuCocoa KazuCocoa changed the title Old WebDriver agent issue still persists Not able to call 'setSetting' API Mar 5, 2020
@jineshqa
Copy link
Author

jineshqa commented Mar 5, 2020

Thanks @KazuCocoa

@jineshqa
Copy link
Author

jineshqa commented Mar 5, 2020

@mykola-mokhnach I'm seeing an issue with webdriveragent. What is the best way to log the same?

@jineshqa
Copy link
Author

jineshqa commented Mar 9, 2020

@KazuCocoa @mykola-mokhnach Could any java_client dev guide me?

@KazuCocoa
Copy link
Member

@jineshqa
Copy link
Author

I meant any committers to the java_client project look into this.

@KazuCocoa
Copy link
Member

Perhaps @SrinivasanTarget can help if he has a chance.

This issue is about snapshotTimeout in https://appium.io/docs/en/advanced-concepts/settings/
But setSetting did not work on your env. #1310 (comment)
https://github.com/appium/java-client/search?q=setSetting&unscoped_q=setSetting

@SrinivasanTarget
Copy link
Member

Sure will have a look at this soon.

@jineshqa
Copy link
Author

Thank you Srini @SrinivasanTarget

@jineshqa
Copy link
Author

@SrinivasanTarget did u get a chance to take a look amid all that is happening around us.

@shibupanda
Copy link

shibupanda commented May 8, 2020

I tried latest one as well (7.3.0), I am still getting the error setSetting not found.

@jineshqa I guess setSetting method is available in "AndroidDriver" and "IOSDriver". I mean if we are using AppiumDriver driver = new IOSDriver() then setSetting method is not visible. If we are still taking AppiumDriver instance then typecasting can help us.
((AndroidDriver)driver).setSetting(setting, value);
Hope this comment can help you some extend.

@jineshqa
Copy link
Author

@shibupanda you are right...it requires OS specific driver to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants