Solved

Perform automated click on page after load

Posted on 2008-10-21
3
261 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.net See list of pdf documents in folder and read 2 28
ASP.net VB.net Email  a webpage 3 30
Hovering effect 9 45
Host asp.net pages 5 25
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

943 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

7 Experts available now in Live!

Get 1:1 Help Now