How to get the test outcome programmatically? - visual-studio-2010

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.

Related

How to log into file in cypress?

i want to log each and every step of the process ex: sign up done, user dashboard opened , user profile edited. How can this be achieved by cypress. I tried this using node.js but as cypress runs in browser i cant create file using node.js and also i tried by cy.writefile where it replace the previous this i have written in the file. Is there a way to do this ???
After this i do want to send this log to an email.
Welcome to Stack Overflow. If you run Cypress on a CI Server like CircleCI, it can record your output.
There is also a --record option, where it saves the details of the session for you.
Cypress can record your tests running and make them available in our
Dashboard.
Recorded tests allow you to: See the number of failed, pending and
passing tests. Get the entire stack trace of failed tests. View
screenshots taken when tests fail and when using cy.screenshot().
Watch a video of your entire test run or a clip at the point of test
failure.
You can read more about recording sessions here https://docs.cypress.io/guides/guides/continuous-integration.html#Recording-tests-in-CI

Coded ui test data format wrong only when running on a test agent

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)]

Load Testing in VS2010 doesn't seem to report results

I do the following:
Create a Web Performance Test. Browse around cnn.com while the recorder records the steps.
Create a Load Test. Go through the wizard, attach the Web Perf Test created in the previous step.
Run the Load Test. It seems to run fine with all kinds of colorful statistics and I can see requests going out via TcpView utility. The screen looks like this, while running:
When it's all done, I get a blank screen without any results (see below).
Am I missing something simple?
Load Tests results need to be stored in a database. Have you configure the connection string for the sql server where the LoadTests2010 database exists?
If not, check these links to see how to create the database and configure the connection string:
How to: Create a Load Test Results Repository Using SQL
How to: Select a Load Test Results Repository

Printing from an application in IIS to a networked printer on server

I have a line of code that I can run locally as part of a service that works perfectly fine.
sReportPath = objCrystalUtils.ExportReportToPDF("Report Name", iReportInfoID)
This code is run as a part of a service, and when I unit test it by feeding it data, it ultimately builds the report and prints it.
When I run the exact same piece of code inside an .ashx from an ajax call. The reports are generated (I can see the pdf files being created on disk) but the printing is not happening.
oRpt.PrintToPrinter(objReport.DefaultAutoPrint, True, 0, 0)
In both scenarios the same code is used to print the report. (objReport.DefaultAutoPrint = 0 in both cases)
My only thought is that the location of the code that is calling this method is in a different spot relative to the location of the bills themselves.
The printer that I'm trying to print to is a network printer intalled on my machine, and I'm running Windows 7 IIS 6.1
Any thoughts?
Edit:
Here is a thought... if I'm running one as a unit test locally and im running the other through a web app that is running via IIS, is there a difference in user id and user access to the default printer?
Edit:
So I added my local ASP, IUSR and SYSTEM users to the printer security and allowed them to print... no dice. So I checked the EVERYONE user and it is set to access and NO users are denied... so I think that kinda kills that line of reasoning.
Edit:
I changed the name of this post since I no longer think that the issue is ajax related since If I try to do the same process in code bebehind from a post back instead of running it from an ajax call i still get the same problem.
Patrick, for me it is a known issue of crystal reports, printing a certain report from a running application via IIS.
I got the same issue before, and upon our search for that issue, we got the following;
Report to be generated, exported, and then to be downloaded to client machine,
so user can print it locally (say, report will be exported as PDf file,
user can use print option of PDF reader).
It's not Crystal Reports or other third party app's problem. It's usually the IIS_IUSER's permission problem because it has no access to any network printers. A possible solution is in Process.Start doesn't work in IIS

Cannot store load test results in a TFS 2005 results store

I've setup a results store and when I publish results of a load test, I can't view the published test details.
From the test run section of the build report I click on the published build and when I choose View Test Results Details from the Test Runs shortcut menu I get an error that the test results details cannot be viewed because the results were not stored in a results store.
I've looked for the data in the results store database and I don't anything there so the error makes sense.
I've setup a connection string to the results store in the Administer Test Controller dialog. Is this the only thing that needs to be done to get test results into the store?
The reports aren't going to be available until after the data has been copied to the data warehouse. This can typically take up to one hour to do.
See http://msdn.microsoft.com/en-us/library/ms404692(VS.80).aspx

Resources