how to get the document object from crosscheck?

1 view
Skip to first unread message

jat

unread,
Jul 1, 2008, 4:55:55 AM7/1/08
to crosscheck
I am now using crosscheck to run some javascript, and I hope I can get
the dom after the javascript is executed.

For example: the following is part of common-dom.jst.

crosscheck.addTest({
test_height_properties: function() {
var elem = document.createElement('div');
elem.style.height = '20px';
document.body.appendChild(elem)

},
})

I hope after "test_height_properties" is executed, I can get the dom
who has a child <div style="height:20px"/>. I wonder how can I make
that.

I write a java test to see whether I can get the right thing as
following:
public void test()
{
String fileName="test/net/thefrontside/crosscheck/hosts/
browser/common-dom.jst";
Crosscheck crosscheck = new Crosscheck();
crosscheck.addCrosscheckListener( new StatusListener());
File sourceFile = new File(fileName);
if (sourceFile.isFile())
crosscheck.addTestSource(sourceFile.getName(), new
FileReader(sourceFile));
crosscheck.runAll(env);
BrowserTestInterface browser= env.getBrowser();
BaseElement node=browser.getDocument().getDocumentElement();
System.out.println(node.get_innerHTML());
}

while the result is just "<head/><body/>".

can anyone help me?

thanks
jat.
Reply all
Reply to author
Forward
0 new messages