phimage / Erik

Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.
http://phimage.github.io/Erik/
MIT License
597 stars 47 forks source link

How to update html ? #18

Closed MasterSwift closed 7 years ago

MasterSwift commented 8 years ago

Are there any sample projects on executive javascript functions and even submitting forms? The example with google search is not working.

phimage commented 8 years ago

"The example"? are you talking about unit test? If yes the code is good, just there is some issues with the parser and google which provide only a part of the full HTML (due to many javascript)

I try to inject HTML ie. full content of a Node using a new proprety "content" using new Kanna feature https://github.com/tid-kijyun/Kanna/issues/30 but my test is not concluent

phimage commented 8 years ago

see https://github.com/phimage/Erik#warning-about-dom-change you must request a new dom parsing after any modification using currentContent if you want to see if username has been filled

MasterSwift commented 8 years ago

I submitted the form but I want to do a re-direct to another link on that website. after doing form.submit , I tried Erik.current content and then Erik.visit but didnt work. Even if I do Erik.visit after form.submit, it doesnt work. it just brings me to the same page with the login form

phimage commented 8 years ago

I update the OSX app, the "test" button fill the google form and then launch submit on the form without any issue

After doing form submit, it's your server which redirect to a page (depending on "action" of form) If you wait sometime you can get the url.