Friday, March 20, 2009

Is it possible to add console application to the webtest

Is it possible to add console application to the webtest


I wanna give some user input from the console and web test will take this input as a variable and process this variable like console program.

Is it possible???

Thanks
Jaeed

-------------------------------------------------------------------------------------------------

Re: Is it possible to add console application to the webtest Was this post helpful ?

if it was possible, I think it would break things when you went to run the webtest as part of a loadtest with multiple users. And how should the test measure the test time, etc for the test when it spends time waiting on your user input?

Does the input really need to be from the console? or could it be via a datasource such as a file? that would be fairly easy to implement.. but taking console input poses all sorts of problems as far as I could predict..

--Chuck


Re: Is it possible to add console application to the webtest

Thanks
---------------------------------------------------------------------------------------------------------------


Re: Is it possible to add console application to the webtest Was this post helpful ?

I haven't attempted to use this in a loadtest (and don't expect to) but look at:

http://www.mdibb.net/net/using_the_visual_basic_input_box_in_c/

------------------------------------------------------------------------------------------------

Using the Visual Basic Input Box in C#In all versions of Visual Basic as far back as I can remember, there has been the venerable InputBox function which has been great for quickly getting an input from the user. VB.NET has it too, but C# doesn't, and it is sorely missed.

However, there is a simple solution. We can simply "borrow" the InputBox from VB.NET, by adding a reference to the required assemblies. To do this in Visual Studio, follow the steps below
In the Solution Explorer, right click on the "References" folder and select "Add Reference..."
In the ".NET" tab, scroll down and select the "Microsoft.VisualBasic" entry, then click "Ok". If you've done that ok then you should now see the reference added to the References folder. Interestingly, in .NET we can specify the location of the InputBox on screen, which I don't think you could do in the old VB days. Anyway, to use it in your code you could use code based on this example: String Prompt = "Please enter your name"; String Title = "Input Required"; String Default = "Bob"; Int32 XPos = ((SystemInformation.WorkingArea.Width/2)-200); Int32 YPos = ((SystemInformation.WorkingArea.Height/2)-100); String Result = Microsoft.VisualBasic.Interaction.InputBox(Prompt,Title,Default,XPos,YPos) if(Result != "") { MessageBox.Show("Hello " + Result); } else { MessageBox.Show("Hello whoever you are..."); } Here we are just asking for a user's name (with a default of "Bob") using a (roughly) centred InputBox, and then just saying hello with a standard message box. Unfortunately, along with inheriting the InputBox itself, .NET has also inherited its String return type - you wont find a nice object encapsulating the response like we get with the DialogResult. Because of this we need to check the string returned - if the user cancels the dialog, the string will be zero-length, otherwise it will be whatever the user typed into the input box. Note here that I've used the full name for the InputBox function. There is nothing to stop you sticking using Microsoft.VisualBasic; at the top of your class to avoid having to type out the full thing each time. Nothing special is required for compilation or distribution if you use this. I hope you find this useful - it has saved me a fair bit of time and effort when all you need is some simple text input and dont need a dedicated form.
Back 22.07.2006.
Thanks for the info, I have been looking for this for months :)
" src="http://www.mdibb.net/images/commentname.gif"> Function " src="http://www.mdibb.net/images/arrow.gif" width=2> 05.10.2006
Thank you so much!
" src="http://www.mdibb.net/images/commentname.gif"> Pie-Pacifique " src="http://www.mdibb.net/images/arrow.gif" width=2> 01.02.2007
Its a very good article, that helped me a lot
" src="http://www.mdibb.net/images/commentname.gif"> Anand " src="http://www.mdibb.net/images/arrow.gif" width=2> 27.04.2007
Thanks a lot. It was very useful.
" src="http://www.mdibb.net/images/commentname.gif"> Ponnusamy G " src="http://www.mdibb.net/images/arrow.gif" width=2> 07.06.2007

No comments:

Unix/Linux Commands

  Flow control Syntax break Exit a loop. continue Exit the current iteration of the loop and proceed with the next iteration. Ctrl+C Key com...