Simon icon Simon
Flexible server monitoring

How to simulate click on a webpage?

Hello to everyone, my first post here.

I have a question. I want to monitor a webpage for changes, unfortunately the changes on that webpage are made only if I press a specified button, more exactly the GO! button on this page: http://www.jdetector.com/

The question is how to do a click on the GO! button and how to get the response data from that webpage?

David Sinclair's picture

Re: How to simulate click on a webpage?

Welcome!

The normal approach to monitor forms is to use the form's action URL as the URL in Simon's test, use the Post method, and list the parameters from the form fields in the test.

However, in this case the submit button runs a JavaScript function, which is located in an external file. That makes it trickier.

One possibility is that I notice the same JavaScript function is called when the page is loaded (search the source for "initMakeup"). So it's possible if you just use the page URL, a Post method, and the form parameters, that might work. The only parameter seems to be a text field named, imaginatively enough, "textfield".

Re: How to simulate click on a webpage?

Looks so complicated....
I can't understand this part: "list the parameters from the form fields in the test"
Under the Post Method is a field called "Parameter" and other "Value", but I can't understand what information I need to enter there.

Also I need to use the Service:Web(HTTP) and use the URL: http://www.jdetector.com/ ?

David Sinclair's picture

Re: How to simulate click on a webpage?

Web forms contain controls like checkboxes, radio buttons, popup menus, and text fields. When you click a Submit button, the web page sends the values for those fields (using the "name" and "value" properties) as POST parameters.

So for Simon to simulate submitting a form, you can specify the needed form fields as parameters, where the field "name" is in the "Parameter" column, and the field "value" is in the "Value" column.

Yes, you'd use the Web (HTTP) service, with that URL.

I hope this is more clear.