Solved

Perform automated click on page after load

Posted on 2008-10-21
3
259 Views
Last Modified: 2012-05-05
I am designing a simply utility to test the network speed at a new client, comparing Asp.net pages with Visual WebGUI.

The test entails clicking a test button on a page after it has loaded and then measuring how many clicks can be achieved in certain time frame.  We've realised the limitations of carrying out this click manually, and would like to have the test running sporadically over two days so we can see the busy periods.

With my limited knowledge of javascript and asp, how can I get the client browser to automatically click the button once the page has loaded, so that I can automate the tests?

If you have any knowledge on how to achieve this Visual WebGUI as well, that would be very handy.
0
Comment
Question by:corebiz
3 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
Comment Utility
something like

function autoClick()
{
var btn = document.getElementById('<%=btnName.ClientID%>');
if (btn.click)
{
btn.click()
}
else
{
btn.onclick();
}
}

then at bottom of page or in the body onload

<script>autoClick();</script>
0
 
LVL 10

Expert Comment

by:jinn_hnnl
Comment Utility
Added to crazyman comment:

//this when you want to set time specific time for each click
window.setTimeout("autoClick()", 200)  ;

if you want this button to be clicked as soon as the page is load, then you better do:
<body onLoad="autoClick();">

The autoClick function you can take it from crazyman comment

JINN
0
 

Author Comment

by:corebiz
Comment Utility
Thanks for the two comments.  I am implementing them now.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now