Solved

Perform automated click on page after load

Posted on 2008-10-21
3
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
ID: 22766411
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
ID: 22766556
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
ID: 22766956
Thanks for the two comments.  I am implementing them now.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 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