Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:28:31+00:00 2026-06-13T22:28:31+00:00

This is my javascript , i am manually writing a Stress Test for my

  • 0

This is my javascript , i am manually writing a Stress Test for my web site by making 4 virtual users .

<html>
 <head>
 <script type="text/javascript">
function test() {
var myStringArray = [ "user1", "user2" , "user3" , "user4" ]
var len = myStringArray.length;
for (var i=0; i<len; ++i) {
document.inform.cid.value=myStringArray[0];
document.inform.pw.value="xxxxxx";
document.inform.submit();
}
}
</script>
 </head>

 <body>
  <form name="inform" method="post"  target="newWin" action="http://localhost:8080/logon?debug=1">
  <input type="text" name="cid" >
 <input type="password" name="pw" />
<input type="hidden" name="throttle" value="999" />
    <input type="submit" value="go" onclick="test()">
  </form>
 </body>
</html>

When i ran the above program , its submitting only once , that is with the last user .

My requirement is that , i want to open 4 new windows with 4 virtual users .

Please let me know , how can i open 4 new windows with 4 virtual users .

Thanks .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:28:33+00:00Added an answer on June 13, 2026 at 10:28 pm

    You need to give different values for the form’s target attribute for them to open up in new windows/tabs:

    For example:

    for (var i=0; i<len; ++i) {
    
        document.inform.target = i; // a different target each time
    
        document.inform.cid.value=myStringArray[0];
        document.inform.pw.value="xxxxxx";
        document.inform.submit();
    }
    

    Check this demo (uses jQuery but the concepts are the same): http://jsfiddle.net/dvJMx/


    Edit

    to introduce a delay between each submit, you can do something like:

    Demo: http://jsfiddle.net/dvJMx/1/

    var windowCounter = 1; // make sure you declare this globally
    
    for (var i=0; i<len; ++i) {
    
        setTimeout(function() {
            document.inform.target = windowCounter++; // a different target each time
    
            document.inform.cid.value=myStringArray[0];
            document.inform.pw.value="xxxxxx";
            document.inform.submit();
    
        }, i*1000); // change 1000 to the interval you need in milliseconds
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With this javascript I'm printing list of records: <script type=text/javascript> $(document).ready(function(){ function hide(){ $('#friend_list').fadeIn(100);
I have this Javascript/JQuery code: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script> <script type=text/javascript> name = $(#name).val(); alert(Name:
I have this Javascript: <script language=javascript type=text/javascript> $().ready(function() { $('#ex2').jqm({ajax: 'view.php?id=<?=$objResult[id];?>', trigger: 'a.ex2trigger'}); });
How can I manually trigger a right click using Javascript? I can do this
Here's what I got. <script type=text/javascript> function show_confirm(id) { var r=confirm(Are you sure you
If I manually write those following lines in an HTML file: <div> <input type=button
This Javascript code is using the 'this' keyword inside a nested function (which is
This javascript function takes JSON and formats it to XML. The data is a
This javascript code does not work in IE8, but works in Firefox and Google
This javascript will find all my selects and validate them but I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.