PDA

View Full Version : How to access the DOM hosted within a webkit app



yshome
3rd August 2011, 03:58
I am working on a test automation project, which want to write some test code to trigger web UI event for a webkit app, the app mainUI is a QT winow which contain a webkit browser, I want to get the internal dom element when the browser load URL, that is, access the dom within another process.

I have looked for many existing automation tool and current qt library, but no result.
Is there anyway to do so?:confused:

Thanks

vallidor
3rd August 2011, 08:02
the easiest way i've found is with something like:


QVariant test = webview->page()->mainFrame()->evaluateJavaScript("return document.getElementsByName('choices_');");

qDebug() << test.toList();