-
Notifications
You must be signed in to change notification settings - Fork 2.3k
docs(locators.js): Example - how do I get the image url? #1000
Comments
This is a poor example, since I think the least confusing this here would just be to remove that |
But could you tell me how I can get that value? It's something that I want to do in real life! That's why I got so excited by this example... Rather than delete the fragment from the example, we could show how to get it... On 30 Jun 2014 19:40, "Julie Ralph" [email protected] wrote:
|
I deleted it because I think that it's confusing for an example. There are a couple ways to do this: You can use
So to get the URL of the first book you can do var firstDiv = element.all(by.repeater('book in library').row(0)).first();
firstDiv.element(by.tagName('img')).getAttribute('src'); Or, you can use element(by.repeater('book in library').row(0).column('book.name')).evaluate('book.imgUrl') |
Awesome that worked. I've been trying to do that all day! Thank you! |
Hi @juliemr I can see very clearly that you helped so many people. Please help me to get out one problem.
So how can i get the actual value of (obj.data) using protractor? I tried to use getAttribue() method but it's returning only (obj.data) as text not the value of it. So how can i get the actual value of it. Please help me. Thank You Regards, |
Your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help. From the the getting help section of the README:
If you post it on Stackoverflow and provide more info I'll try to answer it. |
Will post it there but it's a small problem please reply here only. I need the solution asap. If you reply then that would be really helpful. |
hello
and my code is
it met error: |
@TakaDN Your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help. From the the getting help section of the README:
Thanks! |
The documentation example for "by.repeater" show the following html:
However, it doesn't show how I can get the value for "book.imgUrl".
I've tried:
element.all(by.repeater('book in library').column('imgUrl'));
But I get the error message:
Error: No element found using locator: by.repeater("book in library").column("imgUrl")
Could we have some extra description in the docs on how to check this particular property please?
The text was updated successfully, but these errors were encountered: