Thursday, July 18, 2013

How to add addtional browsers in Visual Studio 2010

Luckily we can add additional browsers by creating new .browser files in Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Templates\LoadTest\Browsers (Program Files (x86) on 64-bit systems).  The files are simple XML documents that include a name and a few header items such as user agent so there isn’t really anything scary in there.  For example, the definition for IE8 is as follows:
<Browser Name="Internet Explorer 8.0" MaxConnections="6">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>
 
Same way you can add other browser like below:
 
Add Internet Explorer 9:
 
<Browser Name="Internet Explorer 9.0" MaxConnections="6">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>
 
Add Internet Explorer 10:
 
<Browser Name="Internet Explorer 10.0" MaxConnections="6">
  <Headers>
    <Header Name="User-Agent" Value="Mozilla/6.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)" />
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="GZIP" />
  </Headers>
</Browser>
 
 
Add Crome 11:
 
<Browser Name="Chrome 11" MaxConnections="6">
  <Headers>   
    <Header Name="User-Agent" Value="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24"/>
    <Header Name="Accept" Value="*/*" />
    <Header Name="Accept-Language" Value="{{$IEAcceptLanguage}}" />
    <Header Name="Accept-Encoding" Value="gzip" />
    <Header Name="Accept-Charset" Value="ISO-8859-1,*,utf-8" />
  </Headers>
</Browser>

Tuesday, May 31, 2011

How to Import a wiq file to an existing project?

Hi,

I wanted to manually modify the SQL of a query (to add parentesis to the conditions of the query).

I can save the query to my desktop as a wiq file, then I can edit it with notepad and add the parenteiss in my WHERE conditions.

But the question is... how can I import again this query to my team system project?

Thanks
===========================================
Answer:

Open the wiq file into Visual Studio.
Be sure to activate the Team Explorer tool window (so the connection to TFS is made)
Choose Save As from the File menu
You can now choose to add the wiq file to the team queries or my queries of TFS

How to associate automated test to a test case in MTM(Microsoft Test Manager)

When clicking on the Associated Automation tab for a test case, all options are disabled. Any ideas on what needs to be done for this to become active?
=========================================================================

Answer: The automation control is enabled only while in Visual Studio. Only test cases loaded in the current solution are available to select.
In MTTLM, this control is read only as per design. Thanks.

Thursday, May 19, 2011

The agent process was stopped while the test was running

I have successfully ran a web test and then added a webtest plug in with it. After that I generated coded webtest for this and try to run it and getting an error saying--"The agent process was stopped while the test was running."

Please let me know why it is throwing this error. Mention that I am using VS 2010 ultimate. VS 2008 doesn;t have any problem on webtest plug in.
==================================================
Hello,

Could you please verify whether the test is already running in 'Test Runs' window when you decide to run it?

When you run the declarative test after adding plug-in, are there any issues?

If you debug the test(right-click the test in test view, choose 'debug selection'), could you find anything helpful?

Thanks.
---------------------------------------------------------------------------
Edwer Fang [MSFT]
===============================================================
You asked: Could you please verify whether the test is already running in 'Test Runs' window when you decide to run it?

Answer:No, the test is not running in 'Test Runs's

You asked: When you run the declarative test after adding plug-in, are there any issues?

Answer: Yes that is the issue I'm talking about in this post..

You asked:If you debug the test(right-click the test in test view, choose 'debug selection'), could you find anything helpful?

Answer: the test run stop at this request:





this.PreRequestDataBinding += new EventHandler(this.testPlugin0.PreRequestDataBinding);

and threw an error as follows:

"The runtime has encountered a fatal error. The address of the error was at 0xeb567b50, on thread 0x15cc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack."

If you need full code, please let me know. Thanks,

===================================================

Hello,

Could you please run as Administrator(righ-click the shortcut for VS, choose 'Run As Administrator') to see if this issue exists?

In addition, if you recreate the project start from scratch, does this issue still exist?

What is the version of your VS?

Thanks.


--------------------------------------------------------------------------------
Edwer Fang [MSFT]
===================================================
Hi Edwer,

I was running test as Administrator and in this case the issue exist.

Even I recreate the project from scratch, the issue still exist.

Version of VS: VS 2010 version 10.0.31118.1 SP1 Rel

Microsoft .Net Framework version 4.0.30319 SP Rel

Anybody tried web test plug in in VS2010?

Thanks,

Abdur
======================================================
Hello,

Could you please send the project to me for better troubleshooting (v-jinfan@microsoft.com)?

Thanks.


--------------------------------------------------------------------------------
Edwer Fang [MSFT]
===================================
Before sending you the full project, can you just answer me one question: Were you be able to run any web test plugin with VS2010 successfully? If yes then I need to send the code for debugging otherwise it is an obvious bug. Thanks.
===================================
Hi Jaeed,

Yes, we are able to run any web test plugin with VS2010 so this issue is something specific. So Please share your project with Edwer as he requested.

Thanks, Rubel


======================================
Hi Edwer,

I have just sent you the project in your email. Noted that project is so simple that it is hard to belive of failure. Please run "CBSOutdoorCoded.cs" test to see the error.

Regards,

Abdur

====================================
Hello,

Any update on this? I appreciate your response. Thanks. - Jaeed

====================================================
Hi Jaeed,

Can you please send me your project? I'll check on it and will get back to you.

Thanks, Rubel

==============================================
How is this issue now?
--------------------------------------------------------------------------------
Ruiz Yi [MSFT]
============================================
I didn't hear back from Jaeed yet on it.
--------------------------------------------------------------------------------
http://blogs.msdn.com/rubel/
==========================================
Hi Rubel,

Please send me your email address as if I can send the project as attachment. Thanks.-- Jaeed

===========================================
Hi All,

I was able to resolve the issue. Here is what happened:

My web test plugin project's class .Net framework version was differing with regular project.

Regular project's "Microsoft.VisualStudio.QualityTools.WebTestFramework" version was 10.0.0.0

Web test plug project's "Microsoft.VisualStudio.QualityTools.WebTestFramework" version was 8.0.0.0



After replacing the version of 8.0.0.0 by version 10.0.0.0, there is no more issue.

What happened was-- I was upgrading my old 2008 project to 2010 project. But during upgrade time web test plug in project framework wasn't upgraded correctly. I did manually upgrade the version and now I am fine.

I Hope this will be a very helpful post if anyone want to upgrade their VS 2008 version to VS2010 and if they encounter the issue I faced.

Regards.

Abdur

=======================

The agent process was stopped while the test was running

Thursday, October 14, 2010

Space in Query String Parameter TARGET causes Web Performance Test to fail

I entered an item on the VS forums. Edwer Fang was able to reproduce this issue and suggested that I enter a bug here...description below:

I have noticed a specific problem with VS 2010 Web Test playback. Tests that have a Query string Parameter TARGET without a space in the name (ex: Target = Web_Site1) will pass. Tests that have a TARGET with a space in the name (ex: Target = Web Site1) will fail. The tests have been converted from VS 2008, and the same tests pass in VS 2008. In VS 2010 they always fail if the TARGET contains a space. To test this theory I created two duplicate sites (TARGETS), one with and one without a space. I ran the same web test against both sites, using different logins to cause the re-directs to either TARGET site. The one with the space fails, the one without passes.

Any known bugs and / or workarounds for this issue? For now, I am going to attempt to re-record the same test to see if the value is handled properly when recorded in VS 2010 instead of using a test that was converted from VS 2008. Unfortunately, I don't have time to record and debug my entire suite of web tests to handle the space issue and re-naming the TARGET sites to eliminate spaces is not an option.
--------------------------------------------------------------------------------------------------------------------
It seems like the authentication process immediately rejects the request if there is a space in the actual target name...Possibly because it is looking for the space, instead it gets a +, and responds with a 401 - BAD REQUEST. The failed requests in VS 2010 appear identical to the same passed request in VS 2008, TARGET=Web+Site1.

Re-recording the test with VS 2010 produces the same error.

I recorded this same login action with Fiddler and I see that the initilal login request is contains TARGET=Web Site1. A subsequent redirect then contains a + and shows TARGET=Web+Site1. VS 2010 never gets to this redirect, which leads me to believe that perhaps the + sign is being forced into the initial request by VS 2010, causing the error. Does VS 2010 do anything different than VS 2008 in this regard, becuse nothing is different between the two enviornments except the failure with sites containing a space? There also doesn't seem to be any way for me to manipulate this request within the web test, and try to force the space. It's like VS 2010 is doing this automatically, where VS 2008 did not?????

Friday, August 20, 2010

Unable to pass date value dd/mm/yyyy through csv file data binding in the webtest.

Hi,

I am using CSV file for data binding in my Webtest.
I have to pass the date value in this format dd/mm/yyyy, through csv file.
I am using excelsheet and then i am saving this file into .CSV format.
When i am adding this file as a data source,all the data rows displayed correctly.
But the date values displayed in the format m/dd/yyyy,which is not acceptable by the application.
How i can change CSV file date format from m/dd/yyyy to dd/mm/yyyy?
---------------------------------------------------------------------
If I may offer a suggestion to determine where the problem lies...

Instead of using a CSV file for the Date of Birth, create a Context Parameter called DOB and give it a value of 15/05/1987. Use the context parameter in place of the data bound parameter to see if it is translating it the same way (with Date & Time) or as you expect it to (dd/mm/yyyy).

If it work this way, you may need to force a format of the data from the CSV file. I would suggest that you look at the UKVSTS Web Test Plugin (http://www.codeplex.com/UKVSTS/Wiki/View.aspx?title=UKVSTS%20Web%20Test%20Plug%20In&referringTitle=Home). This might help.

Good luck.
----------------------------------------------------------------
Hi,

Thanks for your reply.

I have tried following options:

1. ctl00$ContentPlaceHolder1$ClientDetailControl$TextBoxDateOfBirth= <%= DateTime.Now.ToString ("15/05/1987") %> ,I have used same thing which has given in the UKVSTS.script is passing.

But when i tried to pass date values through .csv in this script variable again i was getting date and time.I have used dd/mm/yyyy format in the .csv.

2.ctl00$ContentPlaceHolder1$ClientDetailControl$TextBoxDateOfBirth=

<%= DateTime.Now.ToString ("{{DataSource1.DateValue#csv.DOB2}}") %>

getting same error.

I have used script parameter not context parameter...can you explain how i can create context parameter?
================================================================
I believe that you have misinterpreted the examples provided for the plugin by using the DateTime.Now.ToString function. I believe that what you should be doing is this:

<%= String.Format("{0:dd/MM/yyyy}", DateTime.Parse({{DataSource1.DateValue#csv.DOB2}}))) %>

(Note: I may be missing a paren or curly brace somewhere)

Good luck.

======================================================
Thanks Lewis,

It is working fine.

Thanks,

Bhawana

Wednesday, July 15, 2009

Connect to test run - Cross Domain

Hello,

Trying to figure out a way to share test run results. Our test rig (controller and agents) are all in one domain and all of our development work is done in another domain. Currently, I have installed a Visual Studio instance on the machine that host the controller. This is where I have been managing the test runs from but need to be able to share the results with other developers. Other users all have access to Visual Studio but are all installed on a separate domain. When using Visual Studio in a different domain and trying to connect to the controller I get the error "Connecting to the controller on machine '.....' failed. The server has rejected the client credentials."

Is there any way to allow anonymous connection to the controller to view the test results?

The other thing I have tried is exporting a TRX file but after clicking on the test run the status becomes "Reading test results from database..." followed by the error "Could not read result repository: Could not access the load test results repository......". I can connect to the database through Microsoft SQL Server Management Studio using an SQL logon. I can't see anywhere in the TRX file that defines the connection?

Thank!
===================================================================================
Hi discofunk25

Let's say your controller locates in domain A. Your developers use Visual Studio from domain B. If domain A trusts domain B and your developers use accounts from domain B to log in their computers, you can add their account to TeamTestControllerUsers group created when installing test controller. Then those users should be able to connect to the controller via VS.
===================================================================================
Thanks for your response Bill. Unfortunately domain A doesn't trust domain B and we don't have the power to change that. The sites the physical domains are on are geographically separate with lots of firewalls and red tape. The way I setup the agents originally was using the "workgroup" method (same username/password). I'm wondering if the developers run an instance of VS with the same username/password would do the trick?
==================================================================================
The trick of using the same username/password is to work around the NTLM authentication. In a domain environemnt, Windows usually tries kerberos authentication first. When it fails, Windows will try NTML authentication.

The drawback of creating multiple copy of the same username/password on different computers is obvious. It's difficult to maintain, especially you have a great many of accounts and computers.

Have you tried the Export load test feature? See How to: Export Results from a Repository. I think you can export load test in a computer from DomainA. Copy the exported file to a computer in DomainB. Then import the result to a load test database in domainB. In this way, DomainB users should be able to view result. Below are steps you can try:
In a computer in DomainA, export load test result per How to: Export Results from a Repository.
Install SQL Server 2005/2008 on a computer in DomainB. You can also use an existing SQL instance.
In a computer in DomainB where VSTT is installed, locate the script file loadtestresultsrepository.sql in %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE. This file is used to create load test database that store load test results.
Execute loadtestresultsrepository.sql on a SQL instance picked in step 2. It will create a database named "LoadTest".
For computers in DomainB, connect to the local load test host and select it to use repository you created in step 4. See How to: Select a Load Test Results Repository.
Import the load test result you exported in step 1. See How to: Import Results into a Repository.
====================================================================================

Friday, May 15, 2009

How could I show performance issues on other servers compared to load test results

I have some Unix machines that we need to monitor performance on while we run our load tests. Is there a good methodology on how this should be done?
Thanks- Claucher
=======================================================
Hi CLaucher

There's no support to collect Unix/Linux performace information in the Visual Studio load test. I wish I had a more helpful reply.
-Bill.Wang(MSFT)
=======================================================
Hi CLaucher,

I am guesing your database residing on those unix/linux servers. In this case, you can run some unix commands(performance related) on those unix machines to monitor the performance. You can tell DBA who administer those severs to send you the performance matrix(by unix command) during the period of ur load test.

I hope it helps.
Thanks -- Jaeed
=========================================================

Thursday, May 14, 2009

VSTestHost.exe uses only one CPU

I recently noticed that while running a load test, VStestHost.exe uses only one CPU. Trying to change the affinity through task manager has no effect and it continues to run on CPU0. Is that expected behavior or there's something wrong in the way I am executing the load.
==============================================================================
Hi Pawan,

This is by design in Visual Studio 2008. To drive additoinal load, and utilize all CPUs, you need the Test Load Agent / Controller to create your test rig.

Robert
==============================================================================
Thanks George,

so what it indirectly means is that I'll have to procure additional licenses for Load Agent and Controller.
Just wondering if both of em are shipped as part of the MSDN subscription?

Pawan

==============================================================================
Hi Pawan,

Each Load Agent license covers a controller, so the controller is part of the Load Agent purchase. For MSDN, they have a trial version, but be warned its double time bombed - I think its 60-days or 25 test runs, whichever comes first.

Robert

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...