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

Way to get Text of element? #36

Open
DarkActive opened this issue Mar 13, 2013 · 4 comments
Open

Way to get Text of element? #36

DarkActive opened this issue Mar 13, 2013 · 4 comments

Comments

@DarkActive
Copy link

Hey great work on the library by the way.

I've been looking around and can't seem to find any functionality to get text within an element or an attribute. For example If I was trying to get the text inside a textarea element

Is there are current implementation to do this or will you be adding it in the near future?

@adam-lynch
Copy link

I've only just started using these bindings but the other day I tried to read the text from a textfield based on what the API says;

$session->element(...)->getText(); //as far as I remamber, or it might be just ->text()

But that didn't work (returned the empty string) so I had to get the text via the value attribute;

$session->element(...)->attribute('value')

Try getText() / text() if you haven't already, but for me it didn't work for an input[type=text]

@DarkActive
Copy link
Author

Alright thanks, I'll try it out and let you know what I figure out.

@DarkActive
Copy link
Author

Yea ->text() seems to do the trick for values inside a specific element tag. Thanks.

@adam-lynch
Copy link

👍

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

2 participants