Submitting form with valid data does nothing, with invalid data page reloads

24 views
Skip to first unread message

Phantom

unread,
Jan 29, 2017, 1:22:36 PM1/29/17
to phantomjs
I need some help with this I wasted all weekend trying to figure it out.

I'm trying to automate this page: http://www.zoopla.co.uk/friend/42816744?section=for-sale&search_identifier=6323219902a84fc51cd97861178ef6ce

For the submit button I've tried using both of these findBy:

@FindBy(id="friend_submit")

@FindBy(xpath="//input[@type='submit']")

It works fine using ChromeDriver, I can fill in the form and then submit it and see the "Thank you" message on the next page.


When using phantomJS if I just leave the fields blank and click the button I get the "This field is required." message displayed on the page and the test passes.


When using real valid data and click the button nothing happens, I just stay on the page. I take a screenshot when the test fails and I can see I am on the same form page with all the data correctly entered into the fields but for some reason the form isn't submitted.


As I say it works fine with ChromeDriver.


I've tried using the java script executor, calling.submit() on the element, calling submit() on other elements in the form, waiting before and after clicking the button, scrolling to the web element, used many different versions of phantomjs.exe including beta versions (I'm using the webdrivermanager https://github.com/bonigarcia/webdrivermanager), set the screensize to full screen, custom screen sizes, maximised, set the desired capabilities to allow all ssl, set different user agents, enabled javascript...


I really don't know what else to try.


Please can anyone have a look and see if they can get this page to submit using phantomJS and Java? Or suggest anything I could try.

Phantom

unread,
Jan 29, 2017, 1:25:19 PM1/29/17
to phantomjs
Sorry I forgot to mention, no errors are being thrown the test just fails because it expects the url to contain /success/  and for the h1 to contain "Thank you" but because the form submits it fails. As I said it works fine using ChromeDriver
Reply all
Reply to author
Forward
0 new messages