Skip to content

[Appium] grabAttributeFrom method can't be used with #id selector #2759

@chilikasha

Description

@chilikasha

What are you trying to achieve?

Trying to use grabAttributeFrom method which is present in Appium helper documentation
https://codecept.io/helpers/Appium.html#grabattributefrom

What do you get instead?

I see this there is no grabAttributeFrom function inside the Appium helper class in codeceptjs: https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/helper/Appium.js

If use it with id from a native Android app like I.grabAttributeFrom("#some.app:id/nextBtn", 'enabled'), then I get error

Invalid CSS selector '#some.app:id/nextBtn'. Reason: 'Error: Rule expected but "/" found.'

as a workaround this seems to work
I.grabAttributeFrom("//android.widget.Button[@resource-id='some.app:id/nextBtn']")

Details

  • CodeceptJS version: 3.0.4
  • NodeJS Version: 14.5.2
  • Operating System: Mac OS 10.14.6
  • appium

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions