Misleading error on using XCUITest to select a non-existant attribute
See original GitHub issueThe problem
While crafting selectors to work through a smartphone app, I was exploring my options for selecting a certain element, and generated the error I document below.
I was trying to select the enabled
attribute, although value
was the correct choice. That isn’t the bug report, though - I suspect that the log I’m attaching highlights some crash or other underlying issue. Either way I think the error message is confusing and opaque - our iOS developer told me it’s the sort of error that should be caught at compile time, happening due to misconfiguration.
In the example I am using aoeuasdf
as the example selector. The issue I am reporting here is that the error message that results is very opaque, and possibly shows some underlying issue with the server. In the specific example of the Python driver, something like a KeyError would been more helpful.
Environment
- Appium version: 1.6.0-beta3
- Desktop OS/version used to run Appium: OSX
- Node.js version (unless using Appium.app|exe): v7.0.0
- Mobile platform/version under test: iOS 10.1 on iPhone 6S
- Real device or emulator/simulator: Real device
- Appium CLI or Appium.app|exe: Python driver
Link to Appium logs
https://gist.github.com/emil-petersen/5406e77d1c767a369de7168af8d4e2e4
Code To Reproduce Issue [ Good To Have ]
Using the Python driver:
things = driver.find_elements_by_xpath(
'//XCUIElementTypeTable/XCUIElementTypeCell/XCUIElementTypeSwitch')
dictionary['things'] = [
(source.get_attribute('name'), source.get_attribute('aoeuasdf')) for source in
things if source.get_attribute('name')]
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
@emil-petersen I’m currently working on setting rules for elements attributes. In general, this starts with https://github.com/facebook/WebDriverAgent/pull/379 PR and then I plan to standardise available properties for all other external accessors, like getAttribute. This standardisation is based on FBElement protocol
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.