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

Tests with scripted tests in them are all failing

5 Answers 174 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eliza
Top achievements
Rank 1
Eliza asked on 13 Apr 2011, 09:19 PM
Running: QA test studio 2010.3.1421.0 on XP Pro SP3


Verbose log attached as well as a screen shot of the test that failed, the error message and the directory where the test files are kept.

Test purpose: To shut down a main browser window a pop-up was launched from and verify the pop-up did not shut down as well.

So I recorded:
Launch browser
Navigate to test URL
Launch pop-up
Then I added in a scripted step:
ActiveBrowser.Close()
Then I recorded:
Navigate to test URL again

I also copied this as a template to three other test which increased in complexity.

I verified each one ran without issues as I added more recording.

Then, on the third test script one of the test steps failed as I forgot to put the correct expression in the scripted step. I fixed it but the test would still not run (See error.jpeg attached for details) and all the steps were flagged with yellow warning symbols.

I went back to the first script (which had run without error earlier on) and it failed with an error too. Despite saving the projects and tests. re-starting Test Studio and re-booting the machine ALL tests are now failing. If I delete all the tests steps after the manual step, the tests will pass but I need the manual step as it is required functionality for the product and I cannot move on to the other tests on the pop-up menu without it working.

So why did all the earlier tests fail after they had run sucessfully and what can I do to stop it happening again?

The contents of the logging from the help  screen say:
[21:16] - LogMessage: [21:16:49] - WebUI Test Studio (version:2010.3.1421.0) started.
    ======  ======
    Title: Initiate log
    Message:
    Title: Initiate InternalManager
    Message: Trying to Validate License
    Title: Requesting EVT
    Message: EVTP
    Title: Requesting Validation
    Message: ILMValidate
    Title: ILMValidate action
    Message: Set PC
    Title: ILMValidate action
    Message: Check for VL
    Title: LICENSER
    Message: TRL MODE
    Title: LICENSER
    Message: DS LEFT18
    Title: LICENSER
    Message: DT MARK PASSED18.00:00:00
    Title: ILMValidate action
    Message: ITM TRUE
    Title: MLW action
    Message: MLW  CNSTR: True
    Title: MLW action
    Message: MLW  IC SUCCESS
    Title: MLW action
    Message: MLW LITS REQ
    Title: MLW action
    Message: MLW LITS REQ SUCCESS
    Title: ILMValidate action
    Message: ITM SHD
    Title: ILMValidate action
    Message: ITM TRUE
    Title: Requesting Validation
    Message: ILMValidate True
    Title: Requesting Validation
    Message: ILMValidate True Trial
    [21:21] - LogMessage: [21:21:39] - Active Project is : 'CONTACTS_1'
    [21:21] - LogMessage: [21:21:39] - Project 'CONTACTS_1' Ready.
    [21:21] - LogMessage: [21:21:53] - Test '00.' selected.
    [21:22] - LogMessage: [21:22:37] - Test '00.' selected.
    [21:22] - ------- Function Start 'StandaloneHost.EditControlledFiles' -------
    [21:22] - Project is offline or uncontrolled; making files writeable
    [21:22] - ------- Function End 'StandaloneHost.EditControlledFiles' -------
    [21:22] - ------- Function Start 'StandaloneHost.EditControlledFiles' -------
    [21:22] - Project is offline or uncontrolled; making files writeable
    [21:22] - ------- Function End 'StandaloneHost.EditControlledFiles' -------
    [21:22] - ------- Function Start 'StandaloneHost.EditControlledFiles' -------
    [21:22] - Project is offline or uncontrolled; making files writeable
    [21:22] - ------- Function End 'StandaloneHost.EditControlledFiles' -------
    [21:22] - ------- Function Start 'StandaloneHost.EditControlledFiles' -------
    [21:22] - Project is offline or uncontrolled; making files writeable
    [21:22] - ------- Function End 'StandaloneHost.EditControlledFiles' -------
    [21:23] - ------- Function Start 'StandaloneHost.EditControlledFiles' -------
    [21:23] - Project is offline or uncontrolled; making files writeable
    [21:23] - ------- Function End 'StandaloneHost.EditControlledFiles' -------


I am wondering why all the tests failed after that one mistake I made and what can I do to get them running normally again?

Thanks for reading -
E.

5 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 14 Apr 2011, 12:44 PM
Hello Eliza,
   please upgrade to the Lastest Internal Build 1607 (I can see from your account info that you've already downloaded it).

1421 has a known issue with Coded steps when you run your tests in a TestList (not see when individually running them from Quick Execution).
 
Let me know if the issue persists after upgrading.

Kind regards,
Stoich
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Eliza
Top achievements
Rank 1
answered on 14 Apr 2011, 12:47 PM
Hi there, I wasn't running them from lists. They were being run from quick execution but I will try the internal build on a test machine later on this afternoon and let you know how I get on.

Thanks for the response.



Regards
E.
0
Eliza
Top achievements
Rank 1
answered on 14 Apr 2011, 03:19 PM
Hi, I ran and recorded a test with the recorder and added in my manual step as before. It failed ... as before.

Here are the logs:

------------------------------------------------------------'14/04/2011 14:45:55' - Starting execution....
'14/04/2011 14:45:58' - Detected custom code in test. Locating test assembly: TEST.dll.
'14/04/2011 14:45:58' - Assembly Found: C:\TEST\TEST\WebUI Test Studio Projects\TEST\bin\TEST.dll
'14/04/2011 14:45:58' - Loading code class: 'TEST.TEST_Costs'.
'14/04/2011 14:46:04' - Failure detected during execution. Details:------------------------------------------------------------
'14/04/2011 14:46:04' - System.NullReferenceException: Object reference not set to an instance of an object. at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteSteps(AutomationStepList stepList, TestResult testResult, Object codeBehindInstance, Boolean& stopExecution) at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTestIteration(Object codeBehindInstance) at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTest(Test test, TestResult initializationResult) at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(Test test, Settings settings, String deploymentFolder, ExecutionType exeType, Guid lastStepGuid, DebuggerOptions debuggerOptions)------------------------------------------------------------'14/04/2011 14:46:04' - Test completed!

Here is the TEST.aii.cs file:

using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;

using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;

namespace TEST
{

    //
    // You can add custom execution steps by simply
    // adding a void function and decorating it with the [CodedStep]
    // attribute to the test method.
    // Those steps will automatically show up in the test steps on save.
    //
    // The BaseWebAiiTest exposes all key objects that you can use
    // to access the current testcase context. [i.e. ActiveBrowser, Find ..etc]
    //
    // Data driven tests can use the Data[columnIndex] or Data["columnName"]
    // to access data for a specific data iteration.
    //
    // Example:
    //
    // [CodedStep("MyCustom Step Description")]
    // public void MyCustomStep()
    // {
    //        // Custom code goes here
    //      ActiveBrowser.NavigateTo("http://www.google.com");
    //
    //        // Or
    //        ActiveBrowser.NavigateTo(Data["url"]);
    // }
    //
       

    public class TEST_Costs : BaseWebAiiTest
    {
        #region [ Dynamic Pages Reference ]

        private Pages _pages;

        /// <summary>
        /// Gets the Pages object that has references
        /// to all the elements, frames or regions
        /// in this project.
        /// </summary>
        public Pages Pages
        {
            get
            {
                if (_pages == null)
                {
                    _pages = new Pages(Manager.Current);
                }
                return _pages;
            }
        }

        #endregion
       
        // Add your test methods here...
   
        [CodedStep(@"New Coded Step")]
        public void TEST_Costs_CodedStep()
        {
            ActiveBrowser.Close();
        }
    }
}

0
Stoich
Telerik team
answered on 15 Apr 2011, 12:55 PM
Hello Eliza,
     I'm sorry to hear upgrading didn't solve the issue.

Would you please send your entire test project. The error you're getting is generic and unfortunately we won't be able to troubleshoot the issue based on it alone. We need to reproduce the issue locally. Send us the test project along with a description of the necessary actions to recreate it. If we won't be able to reproduce the issue in our environment then please record a video demonstrating the issue occurring.

If you consider this info to be too sensitive for a public forum you can open a support ticket. Unlike a forum thread support tickets are completely confidential. Make sure the support ticket contains a reference to this forum thread.

Hope to hear from you soon.

Best wishes,
Stoich
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Eliza
Top achievements
Rank 1
answered on 13 Jun 2011, 10:20 AM
As WebUI Test Studio is now obsolete, I am happy consider this issue resolved.

I finally solved the reason for this happening.

If I create (record) a new test in the old WebUI Test Studio and then add in a manually scripted step before I run the test for the first time, I see the error.

Steps to repro are:
Record a test in WebUI Test Studio (Launch a browser, browse to a URL, log into a site, click on a link on the login page)
Then add a manual step (Mine was closing the browser as described below)
Save the test
Run the test => Error message as described below.

But if I:
Record a test in WebUI Test Studio (Launch a browser, browse to a URL, log into a site, click on a link on the login page)
Save the test
Run the test => No error message.

and then add a manual step (closing the browser)
Save the test
Run the test => Once again no error message.

Tags
General Discussions
Asked by
Eliza
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Eliza
Top achievements
Rank 1
Share this question
or