_w.document.body will get you to the page content, then .childNodes
will give you all the child nodes. You can also do
_w.document.getElementById('id') and that will let you access the node
directly.. you should look at javascript and DOM for more information
on available methods.
Does this answer your question?
Adam
Thanks!
dir(_w.document)
This will give you a list of all the attributes, you can use dir on
any DOM element.
Another example is:
dir(_w.document.getElementById('nodeID'))
Is there something you are specifically trying to do?
Adam
When I'm creating a test I usually just use the inspector to write
test actions on a particular element. If I want to create and
assertion that something in the DOM is the way that I think it should
be I usually use Firebug Lite (on windmill 0.8.2 click the "Firebug"
link and then in the main app window hitting the Inspect button) and I
find what DOM properties/values would assert what I want. Then I use
IDE inspector again to write an assertion for whatever I figured out.
I hope that helps, it might just confuse things more.
Adam, I think a screencast might be in order?
-Mikeal
I'll send a link to the list when I get something up monday.
Adam
Thanks for the help!
To access the DOM loaded in the browser via the python shell you can
do the following:
windmill -pm shell firefox <url>
xmlrpc_client.execute_command({"method":"commands.execJS", "params":
{"code":"_w.document.body.innerHTML;"}})
That will return you a dump of the body contents. Anything you can do
in JS that returns a string can be substituted in the code param.
Another example would be:
xmlrpc_client.execute_command({"method":"commands.execJS", "params":
{"code":"_w.document.body.childNodes[0].innerHTML;"}})
We don't currently have a method for returning a list of attributes of
a node, but if thats what you are looking for it wouldn't be too
difficult to add, so let me know.
Hope we are on the right track now.
Adam