Ruby Selenium API : This method is part of a private API. - what is this meant?

Hi All,

I need to get value of Password attribute for a text field.

please clarify how to do this ?

I searched Selenium Ruby API for this action

  • (Object) getElementAttribute(element, name)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Not sure what it means by “…part of a private API…”

Thanks,
Vikram

The Selenium project has some internal APIs. You want the public facing one:

element.attribute('text')

Notice how we acquired the attribute without using getElementAttribute.

@bootstraponline

Thanks for clarification.

I tried using element.attribute(‘password’) but got error

This element does not have the ‘password’ attribute

If I see this element in Inspector , it does show password attribute.

Is this bug or I’m using it wrongly

Thanks,
Vikram

I think it’s a bug. Appium probably doesn’t support getting the password attribute. I recommend opening an enhancement request on the issue tracker so this gets fixed. If it shows up in the inspector then it should be possible for the appium devs to add.

Thanks for looking into issue.

I’ve opened new ticket https://github.com/appium/appium/issues/4371

Regards,
Vikram