Impulse08 Posted November 25, 2007 Share Posted November 25, 2007 Hi all, I'm trying to create a simple load tester for a web site. Right now I have a GUI which asks the user how many instances of IE they want to launch for load testing, and then this calls another executable X number of times using the Run command. I don't want to have to have to executables for this. If there a way to do something like this: For $i = 1 to $i = x LoadTest() Next Func LoadTest() ... open web page and run tests .. EndFunc Where the For loop doesn't wait for the function LoadTest() to finish. Is there a way to just run X number of the function LoadTest() at the same time? Thanks. -- If the apocalypse comes... beep me. Link to comment Share on other sites More sharing options...
xzaz Posted November 25, 2007 Share Posted November 25, 2007 Why not: For $i = 1 To 2 Step 1 Loadtest() Next Func loadtest() MsgBox(0,"","Run your program") EndFunc It keeps running like this, or don't use the function and put it straight into the for loop. Where do you want to use it for? Else search the helpfile for Timerdiff Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
Impulse08 Posted November 25, 2007 Author Share Posted November 25, 2007 Why not: For $i = 1 To 2 Step 1 Loadtest() Next Func loadtest() MsgBox(0,"","Run your program") EndFunc It keeps running like this, or don't use the function and put it straight into the for loop. Where do you want to use it for? Else search the helpfile for Timerdiff This will bring up a MsgBox and wait until you press OK. What I would want from this example is two MsgBox immediately without waiting for a user input to press OK first (waiting for the first function to finish). -- If the apocalypse comes... beep me. Link to comment Share on other sites More sharing options...
xzaz Posted November 25, 2007 Share Posted November 25, 2007 (edited) You can set time on the Msg box, (the msg box was a expample btw) MsgBox(0,"Titel","Content",1) Else play with this: Watch out tho #include"GUIConstants.au3" loop(1) Func msgbbox($text) GuiCreate("MsgBox",100,50) GUICtrlCreateLabel("Text",10,10) GuiSetstate() While 1 loop(1) wend endfunc Func loop($i) For $i + 1 To 10 Step 1 msgbbox("Test"&$i) Next Endfunc Edited November 25, 2007 by xzaz Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
Impulse08 Posted November 25, 2007 Author Share Posted November 25, 2007 You can set time on the Msg box, (the msg box was a expample btw) MsgBox(0,"Titel","Content",1)Thanks, but for my example I'm not using a MsgBox. I understand that it was just an example. But the function I run could take minutes because it runs a bunch of load tests, and I want to run all those tests multiple times simultaneously. Thanks. -- If the apocalypse comes... beep me. Link to comment Share on other sites More sharing options...
zfisherdrums Posted November 25, 2007 Share Posted November 25, 2007 Hello Impulse08,What you're describing is concurrency and would require multi-threaded capability. My understanding is that AutoIT does not have this capability and does not plan to implement it.You could workaround this limitation by writing your Load test in a separate script. Then have a Driver script launch however many instances of the Load test script that you need. Depending on how results are captured and persisted, you may need to pass session IDs to the Load test scripts so that the results can be identified later ( i.e., not overwritten by the other instances ).If multi-threaded capability is a requirement for you, test lab, test manager, etc - you'd have to look outside AutoIt. I've posted some alternatives here and here.Zach... Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
Impulse08 Posted November 25, 2007 Author Share Posted November 25, 2007 Hello Impulse08,What you're describing is concurrency and would require multi-threaded capability. My understanding is that AutoIT does not have this capability and does not plan to implement it.You could workaround this limitation by writing your Load test in a separate script. Then have a Driver script launch however many instances of the Load test script that you need. Depending on how results are captured and persisted, you may need to pass session IDs to the Load test scripts so that the results can be identified later ( i.e., not overwritten by the other instances ).If multi-threaded capability is a requirement for you, test lab, test manager, etc - you'd have to look outside AutoIt. I've posted some alternatives here and here.Zach...Thanks. I'll stick to two EXEs then. Just wondering if it was possible using AutoIt. -- If the apocalypse comes... beep me. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now