Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Perform automated click on page after load

Posted on 2008-10-21
3
Medium Priority
?
299 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses

926 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