Coded ui test data format wrong only when running on a test agent - visual-studio-2010

I am using Visual Studio 2010 and have a data driven coded ui test that uses a csv file. The csv file and schema.ini file are both checked in. When I run the test locally the test runs without a problem. When I run the test through Test Manager which sends it to a test agent the test fails because it tries to enter data into a field as 222197120000 instead of 1971-02-22.
The data in the csv file is 1971-02-22.
The coded ui test has the following:
[DeploymentItem("Applicant.csv")]
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\Applicant.csv", "Applicant#csv", DataAccessMethod.Sequential)]

Related

How to generate and print executive summary after running scripts in UFT

I have a keyword driven framework in UFT. List of scripts listed in an excel file. Driver script simply executes one script at a time. After the test run, I get this executive summary from UFT.
How can I customize the executive summary so I can see the more information on the summary like steps details, which steps passed, failed, etc.? Also how can I print the executive summary?
I have a keyword driven framework in UFT. List of scripts listed in an excel file.
Most likely, you are using only one Action in your test suite, you are seeing only 1 test execution report. This is a general drawback of having Excel driven keyword framework. What you need to do is to create your own custom test script start/stop markers and then generate a report (preferably by using a custom XSL).
Sample test result
Notice that in the sample result, the tests are anything which starts with ▬▬ UC_. I've further divided each tests into various parts grouped under ●●● TD_. You then have to read the UFT generated results.xml and convert it into meaningful result. For example, I converted it into an Excel file.

Where is test result stored in MTM 2010?

I am trying to provide a copy of the test result recorded using MTM 2010 to client, do you know where to grab the result?
Thanks.
The test run and its attachments are stored on the TFS server and available via the TFS SDK. See the TestManagementService apis where ITestRun.Attachments would contain all test run associated attachments
var testsvc = tfs.GetService<TestManagementService>()
IEnumerable<ITestRun> testRun = testsvc.GetTeamProject("myteamprojectname").TestRuns; // you can use the query/find
I follow either of below mentioned two ways to analyze my test runs :
Run following command from "Run":
start mtm://[tfsserver:portnumber/tfs/collectionname]/p:[teamproject]/testing/testrun/open?id=
downloading results file (.trx) to my local system:
tcm run /export /id:id /resultsfile:[my_local_path] /collection:CollectionURL /teamproject:project [/login:username,[password]] [/attachment:attachmentname]

Write jmeter script in non-GUI mode

For my project I am required to write jmeter test plan from the command line in a non-interactive mode and save the result to file and then export it to mysql database.
Any idea how to go about?
You usually don't write script in non gui mode.
You run them in non gui mode.
Save them as CSV and inject data after load test in a database using manually written code or some load tool oracle or other db propose.

How to get the test outcome programmatically?

I am using the Visual Studio agents to run VS coded UI tests on a remote test server (the test agent) from my own developer machine (the test controller).
When running tests locally, I was able to access and read the TRX results file that is created once the test had completed, but I am unable to access this file on the remote test server since the TRX results file remains within the Visual Studio folder on the test controller.
The reason I want to access the results file programmatically as I have code to read the file and then to send out the result as an automated email.
So, is there any way to get the outcome of the test programmatically so that I can send out the results email automatically?
Ideally, I would be able to get access to the TRX results file from the test server but I'm not sure if this is feasible or possible.
If you run the coded ui inside of a load test, you can set it to write to the LoadTest2010 database. From there you can set up ways to get the results and trigger events as with any database.

Something similar to NUnit TestCaseSource in Visual Studio unit testing

Is there anything similar to NUnit TestCaseSource attribute in Visual Studio unit testing? The closest solution I found was to use a DataSource. But I don't want to store my test case parameters in a data source.
Datasource is one option to take the test input. You can save your test data in many file format (xml, xls or in sql db)
But if you don't want to store your test data, then use TestInitialize() attribute in any method that will execute before any of your test cases. Save all your test data run time in xml,xls or in sql db through this method and then using datasource use it in your test cases.
Here is msdn link for VSTS unit test. Hope this will help you.

Resources