last day (14 days later) » 

14:54
Hey
thanks for all the help..
Hello pkhabya. I think you have a misunderstanding of how to use .webtest files. I have never needed to create a coded web test except when trying to understand some challenging issues. I only every use .webtest plus plugins for testing.
you were right when u said that the headers were incorrectly placed in the web test
i corrected it and generated the code again and it started working again
since i am not very well versed with the webtests i rely on changing the code myself for parametrization
For login with username and password, first look at data driving the test. Then open the properties panel of the request sending username and password. Click on the username (eg "pkhabya") and click on the "bind" and follow the prompts.
my username and password are in the "String Body"
Have you looked at the many Microsoft web pages on load testing. I recommend them. Also have a look at the (somewhat out of date, but still very useful) content index at blogs.msdn.microsoft.com/visualstudioalm/2013/03/28/…
14:59
is there an easy way to parametrize username and password?
ok.. i will go through the tutorials.. i am running on a very tight schedule and everybody wants things done fast here.. so i had to stick to what I already knew rather than finding the efficient solution.. but thanks a ton.. I could get the things working.
Visit the properties, click on the value and see an editable value. I suggest Control-A for select-all then copy the value into Notepad (or some other editor, I prefer Notepad++). Find the user name (eg "pkhabya") and replace it with something like "{{DataSource1.FileName#csv.FieldName}}" (with the doubled curly braces, without the string quotes).
Doing things fast often means doing it badly and slowly. Spend a little time on learning and do it better and faster.
... having altered the value, overwrite the whole property value with the modified text from the editor.
ok.. i get it now.. i do not need to change the code myself.. i need to bind the data with a datasource (a CSV may be).. I'll give it a shot.. thanks!!
I suggest using an editor like that because the string can be big and the field in the property panel is small.
yes.. i used Notepad ++ myself
Look at how other places in the test use context parameters, how they use the name and enclose it in doubled curly braces.
15:07
ok..
Another mechanism. Open the .webtestfile in Notepad++ making sure you keep good backups of the file in case you break it. See the file is just XML. The stringbody fields are base64 encoded. You can copy the field contents into something like base64decode.org then edit the contents, convert it back and paste back into the webtest file.
There is more on this last method in my blog at microsoft.com/en-gb/developers/articles/week02jun14/…
hmm.. this looks a little daunting at the first sight.. but i'll get there..
Stringbodies may be a good reason for using coded web tests. I have just created a trivial webtest and done the conversion. The relevant line from the string body value 12345{{Abcd}}67890 converts to the coded web test as request1Body.BodyString = ("12345" + (this.Context["Abcd"].ToString() + "67890"));. Obviously Abcd could be replaced with DataSource1.FileName#csv.FieldName.
time to go home.. its 9 pm in India.. cannt thank you enough for the help.. good to talk to you.. bye
OK. It is nearly my going home time here in the UK.
15:59
do u work at Microsoft, UK?

last day (14 days later) »