mkoehnke / WKZombie

WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests / snapshots and manipulate websites using Javascript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PostAction.wait after execute JavaScript?

mashikag opened this issue · comments

Is there any way to make the browser instance wait after .execute JavaScript?

I am executing my own javascript. From the network requests in my MITM proxy I can see the expected requests being executed from the click of the login button. However I believe the result is handled too early. The body of the page is still the one of the browser before executing the document.getElementById('ContentPlaceHolder1_btnlogin').click() .

browser.open(loginUrl) >>> browser.execute("document.getElementById('ContentPlaceHolder1_UserName').value='xxxxxx';document.getElementById('ContentPlaceHolder1_Password').value='yyyyyyy!';document.getElementById('ContentPlaceHolder1_btnlogin').click();") >>> browser.inspect() >>> browser.get(by: .XPathQuery("//body")) === handleResult