failing to get_elements_by_xpath
Short first test using google to get the hang of SST...
To reproduce:
from sst.actions import *
go_to('http://
write_
simulate_
wait_
vals = get_elements_
print vals
Results:
(SST)
Tests running...
DEBUG:
DEBUG:
DEBUG:
DEBUG:SST:Going to... http://
DEBUG:
DEBUG:
DEBUG:SST:Check text wrote correctly
DEBUG:
DEBUG:
test ... []
DEBUG:
OK (8.103 secs)
Ran 1 test in 8.103s
OK
So it did everything and from sst's perspective the test worked, but the print val statement returned an empty list. If you run the XPATH expression "//ol[@
I think I should be getting back 10 elements in my val list but I am obviously missing something simple. Any help would be helpful!
Jon
PS - this looks like a pretty cool tool which wraps most of the selenium functionality in nice pythonic methods. But it has to work :-)
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Jon Rosen
- Solved:
- 2014-04-24
- Last query:
- 2014-04-24
- Last reply:
Jon Rosen (jfr) said : | #1 |
Hi all,
Okay, I figured this out myself :-) I was waiting on the wrong thing. The title apparently gets handled very quickly and SST can beat the browser in its rendering if it assumes that the title means other stuff on the page is ready. I changed it to actually wait for the element I was looking for (the //ol tag with an id of "rso") and voila, everything comes back fine now.
Thanks!
Jon Rosen (jfr) said : | #2 |
Hi all,
Okay, I figured this out myself :-) I was waiting on the wrong thing. The title apparently gets handled very quickly and SST can beat the browser in its rendering if it assumes that the title means other stuff on the page is ready. I changed it to actually wait for the element I was looking for (the //ol tag with an id of "rso") and voila, everything comes back fine now.
Thanks!
Here is the changed script:
from sst.actions import *
go_to('http://
write_
simulate_
wait_
vals = get_elements_
print vals
Now I get back a list of WebElements. Perfection!