What do I do with ....WebElement(s)?
Okay, I got things coming back from my get_element method calls. The question now is, What do I do with them?
I tried inspecting them and there is essentially nothing visible there, just a _parent attribute (which is actually a python object for a Firefox window, I believe), and an _id. Nothing else. I tried dir() and inspect.getsource and got nothing but errors. I realize now that these may not be python objects, but what good is that?
I want to walk through the elements I retrieved in my get_elements_
I looked at the examples and none of the examples show any use of the elements that come back from a get_elements method.
Help please? Thanks!
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Corey Goldberg
- Solved:
- 2014-04-24
- Last query:
- 2014-04-24
- Last reply:
- 2014-04-24
|
#1 |
get_element returns a seleniun.webdriver WebElement instance.
see here for ducmentation:
http://
However, SST is designed with functions for common interaction with elements, so you really don't need to know their own properties or methods often.
but, for example:
sst.actions.
is the same as:
element.click()
Jon Rosen (jfr) said : | #2 |
Hi Corey,
Thanks for the update. I did some investigation on my own and figured out that I could pierce through the WebElement and use its own methods (but there are no attributes, that is apparently all completely opaqued). I also figured out that if I really wanted to, I can use sst's get_element_source to snag all the underlying html from an element and then do whatever I want with it (although that is usually a pretty daunting task).
Are you open to enhancements provided by users to add new methods to the existing functions?
Thanks!
Jon
Jon Rosen (jfr) said : | #3 |
Thanks Corey Goldberg, that solved my question.
Corey Goldberg (coreygoldberg) said : | #4 |
Hi Jon,
> Are you open to enhancements provided by
> users to add new methods to the existing functions?
yes, we are.
It's not a very active project at the moment, as some priorities have shifted for me. But I'm happy to do code reviews and merge enhancements or features (and there are a few other folks familiar with SST's internals to that can approve branches also).
Are you familiar with bzr and using Launchpad for development/review? If so, go ahead and push a branch and propose for merging whenever you want. I suggest doing small features in each branch, rather than dumping a whole set of things at once for review.
If you're not familiar with bzr/launchpad, let me know and I can walk you through it, or point you to some good docs.
-Corey