Telerik Forums
Test Studio Forum
0 answers
567 views
Here is a solution how to perform an automatic re-run of failed tests after a Test List execution finishes. This is done by using the exposed functionality by Test Studio Execution Extension (http://docs.telerik.com/teststudio/user-guide/code-samples/general/execution-extensions.aspx).

Note: This is just an ready-to-use working example to see how this can be achieved, but you can change it in any way and just reuse the concept with your custom implementation (attached is the solution for building the extension, in which to make the customizations).

1. Open the attached execution extension archive (ReRunFailedTestsExecutionExtension.zip) which contains already built execution extension with .Net 4.5

2. The code inside overwrites the default methods OnBeforeTestListStarted(), OnBeforeTestStarted() and OnAfterTestListCompleted() to build a list of failed tests from the Test List result object for later use for the re-run functionality

3. Copy/Paste the ReRunFailedTests.dll and ReRunFailedTests.dll.config files in your [Test Studio installation folder]\Bin\Plugins\ folder so they will be used whenever Test Studio or command line ArtOfTest.Runner.exe are started

4. In the configuration file ReRunFailedTests.dll.config there are several keys that can be changed:
4.1. 'ReRun = True' means the automatic re-run functionality will be triggered for each test list run. If you don't want it to be triggered set it to False
4.2 'ReRunAsList = True' option will execute all failed tests as part of a single new Test List created from the original Test List, but containing only the failed tests from the original list. The 'name' of the new list will be the same as the original list and added (FailedReRun) at the end of it; if 'ReRunAsList' key is set to 'False' the automatic rerun of all failed tests will be performed on test by test basis, meaning failed tests will not be combined in a Test List and executed as tests - this will effect in generating an individual result for each failed test, i.e. if your test list has 100 tests and 10 of them fail, after the rerun you will have single result from the original Test List run and additionally 10 individual small results for each failed test (if using 'True' option you will only have 2 result files in this example, instead of 11 to be shown in Test Studio Results view);
4.3 'ProcessToRun' is the path to where ArtOfTest.Runner.exe is installed (comes with default path installation on x64 machine)

Note1: in order for this approach to work the tests should be written as autonomous tests - created in a way to be executed on their own, without the use of previous tests run before them in a list to make them work properly
Note2: this will work only for local test list executions, not in a remote/scheduled runs on distributed machines
Daniel
Top achievements
Rank 1
 asked on 11 Nov 2014
3 answers
216 views
I have a test (called Refresh_Wrapper) that has a data binding to a .csv file with three rows.  The test correctly runs three times... once for each row in the .csv.

I created a sub-test (called Refresh_Params) which enters the .csv values into the application.  I call this sub-test from my main test.  Now my main test runs three times (correctly).  And I expected it to call the subtest once passing it the data value for that main test's iteration.  But it's calling the sub-test three times (once for each .csv row) within the first iteration of the main test.

In the project tab, I have the main test (Refresh_Wrapper) with DataEnabled checked.  The child test (Refresh_Parameters) has DataEnabled unchecked and InheritParentDataSource checked.

Is there any way to get the child test to run only once per parent test's iteration and to use the data value from the parent test's data binding?
Ivaylo
Telerik team
 answered on 11 Nov 2014
3 answers
110 views
Hi, we have an application in ExtJS and we are doing tests to attempt login. During the execution all steps are good and text is entered for username and password but the condition for enable the login button is false, so we can't progress. We got the same problems when we execute a test list scheduled and sometimes text is not entered. Is the execution too fast? Could you help us?

Roberto
Ivaylo
Telerik team
 answered on 07 Nov 2014
5 answers
202 views
Hi Telerik Team,

I have existing trial projects that have reference to System.Data. However, just recently, I tried to add a new project, I encountered an error regarding missing directive for System.Data. I looked at the references of the new project, and the System.Data is not included. I tried to add reference to it but it was not reflected in the project references. Do you know a workaround for these?

Much thanks,
Kristine
Ivaylo
Telerik team
 answered on 07 Nov 2014
1 answer
127 views
I have created tests by adding excel data binding. The tests work fine. But if I try to run the same tests after a gap of like 2 months, somehow the bindings are lost and my tests pick up data from some other excel workbooks in the project. I have to go back and bind the every step with the data again. How do I resolve this? Can anybody help please?
Ivaylo
Telerik team
 answered on 06 Nov 2014
5 answers
118 views
Hi
I´m using Test studio with Visual Studio 2010 and exporting the Storyboard to html.  Is it possible to modifie export templa with my companies logo and custom text?

cheers
Eyjolfur Bjarnason
Boyan Boev
Telerik team
 answered on 05 Nov 2014
3 answers
312 views
Hi,

I have 2 sites of similar page structure. Here i need to navigate to another page from home by clicking on "first" link (menu option) from left-pane. I am not sure of the name of the link or it's href value. But i have to click on the first link from left-navigation-pane. The link in first site might be completely different from second site. Can i locate this element by using it's 'UL' index in the left pane ?

For the 1st site's element XPath was - /html[1]/body[1]/form[1]/div[2]/div[1]/ul[1]/li[2]/a[1]
For the 2nd site's element XPath was - /html[1]/body[1]/form[1]/div[3]/div[4]/div[1]/div[2]/div[1]/ul[1]/li[2]/a[1]
So i have tried element finding logic as 'XPath' - 'StartsWith' - /html[1]/body[1]/form[1] & 'XPath' - 'EndsWith' - /div[1]/ul[1]/li[2]/a[1]
But the telerik is unable to locate the element as there are other links at the  bottom of the page matching with the same above logic.


Could somebody please help me with this ? I should be able to run the same script/steps in 2 sites.
Thanks in advance

Boyan Boev
Telerik team
 answered on 05 Nov 2014
14 answers
325 views
Hello,

I have the following coded step that identifies a specific image I'm looking for and then clicks on it.  After clicking, I need to handle a dialog box, but I don't believe there is a way to call a regular step from a coded step from what I've seen so far.  So I'm trying to find a way to use this coded step to iteratively find and click on each image, break out to a regular step to handle the dialog, and then repeat the process until all of the images I'm looking for have been clicked.

I set an extracted value of "Repeat" to either "True" or "False" within the coded step.  Is there a way to execute a regular step logical loop based on this value since it's independent of any target on the screen?

Thanks for your help!
Tori

// Find the "Void" (Delete) image gif and click on it.
   
ReadOnlyCollection<HtmlImage> VoidImages = ActiveBrowser.Find.AllByAttributes<HtmlImage>("src=~delete.gif");

if(VoidImages.Count == 0)
    Console.Out.WriteLine("Void Image Not Found. . .continuing. ");

int Count = 0;

foreach(HtmlImage i in VoidImages)
    {  
        Count = Count + 1;
        Console.Out.WriteLine("Image Count = " + Count);
    
        if(i.IsVisible())
            {
            i.ScrollToVisible(ScrollToVisibleType.ElementTopAtWindowTop);
            Log.WriteLine("Visible Void Image Found:  " + Count + " " + i.Src + " clicking! ");
            Console.Out.WriteLine("Visible Void Image Found:  " + Count + " " + i.Src + " clicking! ");
            HtmlImage VisibleImage = i;
                               
            if(Count == VoidImages.Count)
                {
                SetExtractedValue("Repeat", "False");
                Console.Out.WriteLine("Last image, stop looping.");
                Log.WriteLine("Last image, stop looping.");
                }
            else
                {
                SetExtractedValue("Repeat", "True");
                Console.Out.WriteLine("More images remaining, keep looping.");
                Log.WriteLine("More images remaining, keep looping.");    
                }
            VisibleImage.Click();
            break;    
            }    
  }








Cody
Telerik team
 answered on 04 Nov 2014
1 answer
64 views
Hi,
the last few days my remote tests have been executing normally (I can watch them on the scheduling machine) however when I view the results on my client machine it shows that no tests in the test list have been run. Does something on the execution machine need clearing out ?


Thanks TOm.

client version: 2013.1.806.0
Ivaylo
Telerik team
 answered on 04 Nov 2014
3 answers
113 views
How do you do a verification step at the end of a login test, if the login link has the person's name instead of the word Login?

thanks

Wade
Ivaylo
Telerik team
 answered on 03 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?