question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Misleading error on using XCUITest to select a non-existant attribute

See original GitHub issue

The 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:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Dec 2, 2016

@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

0reactions
lock[bot]commented, Apr 28, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XCUITest Multiple matches found error - Stack Overflow
This property only shows up for testing and won't be presented to the user ... Xcode 9 introduces a firstMatch property to solve...
Read more >
appium/CHANGELOG.md - UNPKG
appium/CHANGELOG.md ; 438, some iOS 9.3 tests, if the `automationName` capability is set to `XCUITest`), you ; 439, should also remove the old...
Read more >
Accessible SwiftUI for easy UI testing - Medium
In the absence of an accessibility identifier, UI tests can find an element by the label just as easily. By default in SwiftUI,...
Read more >
Locators In Selenium WebDriver With Examples - LambdaTest
This may lead to issues such as selecting an incorrect element or a non-existent one. To avoid this, always assign a unique ID...
Read more >
@appium/base-driver | Yarn - Package Manager
This is the parent class that all appium drivers inherit from, along with a collection of globally-used Appium driver utilities. Each utility is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found