1

My colleague with a windows machine doesn't have this issue with the same code.

All my tests that pass normally when run in chrome - fail when run headless at the point where the user presses save and continue and another form displays on the same page.

The screenshot shows that the first form is filled out but does not show the second form as having appeared.

I've tried adding a fixed 5 second sleep to allow for any ajax or js (for investigative purposes) but the problem persists.

enter image description here

How can I figure out what the issue is given I don't get to see the browser itself with the issue, i just get the screenshot:

enter image description here

The save and continue button is highlighted but the new form hasn't rendered so the test fails.

  • What are the javascript console errors status? Can you capture that from the tests? – Vishal Aggarwal Jul 14 '18 at 15:25
1

To debug, first try to take a screenshot in headless mode when you arrive at the button. Then take another screenshot before the test fails or after you click the button.

It really looks like you pressed the button but the next screen wasn't triggered. Try to add a timeout before you press the submit button. Maybe 30 seconds, you can reduce this later, in order to ensure that any Javascript updates have run. That way you can definitively rule out Javascript updates.

Make the test slower to rule out any timeout issues. Once it works, you can remove the timeouts because you know the logic works.

  • Thanks, yeah I've tried those. The fact it works on WIndows machines without any sleep is probably relevant. – Michael Durrant Apr 21 '18 at 23:53
  • The windows machines could also have better hardware or on a better network. It could also be that the software doesn't run properly on non-windows machines – newsn31 Apr 21 '18 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.