Using loadUrl() and evalJS() with QWebView

Last edited on

Squish adds these methods to QWebView instances:

Here is an example that uses both methods:

def main()
    [...]

    wv = waitForObject({"type": "QWebView", "unnamed": 1, "visible":1})

    # We can even load a different URL in the webview:
    url = "http://www.froglogic.com/secure"
    wv.loadUrl(url)
    snooze(5)

    title = wv.evalJS('document.title')
    test.compare("froglogic -  Automated Cross-Platform GUI Testing", title)