This is a migrated thread and some comments may be shown as answers.

Display a message box

1 Answer 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ranganath
Top achievements
Rank 1
Ranganath asked on 24 Jan 2011, 07:17 AM
Hi guys,

I need to display a message box with the following information in WEBUI QA Edition.

1) No. of passed Steps and no.of failures steps and total Count of steps in a test case

Please let me know the process, so that i can acheive the above scenario.

Thanks
Ranganath

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 26 Jan 2011, 03:10 PM
Hi Ranganath,
     you have to do this in code. We have a method OnAfterTestCompleted(TestResult result) that can access the results, you'll have to overwrite it.

First you'll need to add a reference to ArtOfTest.WebAii.Design  which can be found here by default:C:\Program Files (x86)\Telerik\WebUI Test Studio 2010.3\Bin
Here's an article that describes hot to add assembly references in QA edition:
http://www.telerik.com/automated-testing-tools/support/kb/project-configuration/adding-assembly-references-in-qa-edition.aspx

Now open your test. If you don't have any Coded Steps add a "Script Step" (see screenshot 1). Now click on the View Class (screenshot 1) to open the class. Add the following logic inside the BaseWebAiiTest (but not inside a method):
public override  void OnAfterTestCompleted(TestResult
           result) {
    int a=  result.TotalPassedSteps;
    int b = result.AllTestStepCount;
      }
This is how you get the number of Passed Steps:
int a=  result.TotalPassedSteps;
and this is how you get all the steps:
int b = result.AllTestStepCount;

WebUi doesn't offer any way to implement a Message Box so you'll have to implement it yourself.

Let me know how it goes!

Regards,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Ranganath
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or