Test List does not execute all code in script

3 posts, 0 answers
  1. Nigel
    Nigel avatar
    53 posts
    Member since:
    Jan 2012

    Posted 28 Mar 2012 Link to this post


    I have an issue with Test Lists. I am running Test Studio version 2011.2.1413.0

    I have a script that iterates through 7 rows of data in a data file. When I run the script directly from the Record tab everything works perfectly. When I run the script from a Test List the script fails at the first iteration. There is no error reported from the Test List.

    The faiure happens at the first IF...ELSE statement in the script. The IF statement test is:
    IF (Verify 'InnerText' 'StartsWith' 'Showing 0' on 'TableUsersInfoDiv') THEN

    On the first pass the IF clause should report TRUE, and it does do that when the script is run from the Record window. Below is an extract from the (verbose) log generated by the Test List execution (and please note that all conditions prior to execution through the Reporting screen and the Test List are identical in every instance):

    Trace] : Wait for 'InnerText' 'StartsWith' 'User List' on 'HtmlTag'
    [Trace] : Click 'AllRadio'
    [Trace] : Click:([Element: 'input:3' (id=all)])
    [Trace] : Enter text 'test' in 'Text' - DataDriven: [$(UserName)]
    [Trace] : SetText:([Element: 'input:1']) - Text:
    [Trace] : ScrollToVisible:([Element: 'input:1']) - ElementTopAtWindowTop
    [Trace] : MouseClick:LeftDown (1108,454)
    [Trace] : MouseClick:LeftUp (1108,454)
    [Trace] : MouseClick:LeftClick (1108,454)
    [Trace] : IF (Verify 'InnerText' 'StartsWith' 'Showing 0' on 'TableUsersInfoDiv') THEN
    [Trace] : Comment: User ID already exists so just logout
    [Trace] : Execute test 'g_Logout'
    [Trace] : Comment: Script: g_GenericLogout; Author: Nigel Edwards; date: 02/03/12
    [Trace] : Execute test 'g_LogoutWaitForButton'
    [Trace] : Comment: Script: g_WaitForLogoutButton; Author: Nigel Edwards; date: 02/03/12

    The COMMENT line reported above is actually within the ELSE clause. This shows that a swathe of code (over 30 lines) within the IF statement is not being executed when run from the Test List. In fact the 'InnerText' does start with 'Showing 0'. I've attached the full test script to this posting, but in brief, what should happen after the IF test is a further verification line immediately followed by a button-click. Instead the Test List version skips to the ELSE clause, which is a Logout command.
    As I say, the script functions 100% correctly when run directly from the Record window.

    A little bit more information for you, here is the .aiilist file from the last time I tried to execute my script through a Test List:

    < TestList Type="ArtOfTest.WebAii.Design.Execution.TestList" Version="2011.2.1413.0">
    <ID Type="System.String">2ac18a53-d0af-4a41-8ed9-d9dee6f17704</ID>
    <TestListName Type="System.String">temp list</TestListName>
    <Date Type="System.DateTime">2012-03-26 12:38:16Z</Date>
    <Settings Type="ArtOfTest.WebAii.Core.Settings" Version="2011.2.1413.0">
    <WebSettings Type="ArtOfTest.WebAii.Core.Settings+WebSettings" Version="2011.2.1413.0">
    <DefaultBrowser Type="ArtOfTest.WebAii.Core.BrowserType">InternetExplorer</DefaultBrowser>
    <WebAppPhysicalPath Type="System.String">
    <EnableScriptLogging Type="System.Boolean">True</EnableScriptLogging>
    <EnableUILessRequestViewing Type="System.Boolean">False</EnableUILessRequestViewing>
    <LocalWebServer Type="ArtOfTest.WebAii.Core.LocalWebServerType">None</LocalWebServer>
    <BaseUrl Type="System.String">
    <AspNetDevServerPort Type="System.Int32">-1</AspNetDevServerPort>
    <KillBrowserProcessOnClose Type="System.Boolean">False</KillBrowserProcessOnClose>
    <RecycleBrowser Type="System.Boolean">True</RecycleBrowser>
    <UseHttpProxy Type="System.Boolean">False</UseHttpProxy>
    <EnableSilverlight Type="System.Boolean">False</EnableSilverlight>
    <VerboseHttpProxy Type="System.Boolean">False</VerboseHttpProxy>
    <SilverlightConnectTimeout Type="System.Int32">30000</SilverlightConnectTimeout>
    <MultiBrowsersExecution />
    <UseMultiBrowsers Type="System.Boolean">False</UseMultiBrowsers>
    <IsProfilingExecution Type="System.Boolean">False</IsProfilingExecution>
    <ProfilerConfigurations />
    <WpfSettings Type="ArtOfTest.WebAii.Core.Settings+WpfSettings" Version="2011.2.1413.0" />
    <ClientReadyTimeout Type="System.Int32">30000</ClientReadyTimeout>
    <ExecuteCommandTimeout Type="System.Int32">20000</ExecuteCommandTimeout>
    <LogLocation Type="System.String">C:\WebAiiLog\</LogLocation>
    <QueryEventLogErrorsOnExit Type="System.Boolean">False</QueryEventLogErrorsOnExit>
    <ExecutionDelay Type="System.Int32">0</ExecutionDelay>
    <AnnotateExecution Type="System.Boolean">True</AnnotateExecution>
    <SimulatedMouseMoveSpeed Type="System.Single">0.3</SimulatedMouseMoveSpeed>
    <WaitCheckInterval Type="System.Int32">500</WaitCheckInterval>
    <AnnotationMode Type="ArtOfTest.WebAii.Core.AnnotationMode">All</AnnotationMode>
    <LogAnnotations Type="System.Boolean">True</LogAnnotations>
    <IsStressRecordingMode Type="System.Boolean">False</IsStressRecordingMode>
    <IsUserInteractiveMode Type="System.Boolean">False</IsUserInteractiveMode>
    <CreateLogFile Type="System.Boolean">True</CreateLogFile>
    <XMultiMgr Type="System.Boolean">True</XMultiMgr>
    <UnexpectedDialogAction Type="ArtOfTest.WebAii.Core.UnexpectedDialogAction">HandleAndFailTest</UnexpectedDialogAction>
    <ElementWaitTimeout Type="System.Int32">10000</ElementWaitTimeout>
    <DisableDialogMonitoring Type="System.Boolean">False</DisableDialogMonitoring>
    <Item Type="ArtOfTest.WebAii.Design.Execution.TestInfo" Version="2011.2.1413.0">
    <ID Type="System.String">a4ece2e6-629e-4997-b575-5abf386e7ed7</ID>
    <Path Type="System.String">SystemAdmin\Users\sa_UsersSetupAllRequired.tstest</Path>
    <Filter Type="ArtOfTest.WebAii.Design.Execution.Filter" Version="2011.2.1413.0">
    <Keys />
    <Comparisons />
    <Values />
    <TestListType Type="ArtOfTest.WebAii.Design.TestListType">Automated</TestListType>
    < /TestList>

    ...also, I have created a stripped down script that also fails in exactly the same way, so it is not just one script. Here's the Test List execution log:

    [Trace] : Execute test 'g_NavigateToURL'
    [Trace] : Comment: Script: g_NavigateToURL; Author: Nigel Edwards; Date: 02/03/12
    [Trace] : Comment: To consistently navigate to the URL and open the LogOn screen
    [Trace] : Comment: Script uses Local Data
    [Trace] : Navigate to Project - DataDriven: [$(URL)]
    [Trace] : NavigateTo: http://vs-demo/BaseProjectQA
    [Trace] : Wait for 'InnerText' 'StartsWith' 'Base Project - Log On' on 'HtmlTag' - DataDriven: [$(LogonScreenTitle)]
    [Trace] : Extract 'TextContent' on 'VersionTagDiv' into DataBindVariable $(VersionNumber)
    [Trace] : *** Version Number is: v ***
    [Trace] : Comment: * End of g_NavigateToURL test script *
    [Trace] : Enter text 'user' in 'TextBoxUserIdText'
    [Trace] : SetText:([Element: 'input:0' (id=textBoxUserId)]) - Text:user
    [Trace] : Enter text 'password' in 'PasswordPassword'
    [Trace] : SetText:([Element: 'input:1' (id=Password)]) - Text:password
    [Trace] : Click 'ButtonLogOnSubmit'
    [Trace] : Click:([Element: 'input:2' (id=ButtonLogOn)])
    [Trace] : Click 'SystemAdminLinkLink'
    [Trace] : Click:([Element: 'a:7' (id=SystemAdminLink)])
    [Trace] : Click 'UsersSpan'
    [Trace] : Click:([Element: 'span:34'])
    [Trace] : Wait for Exists 'CreateNewSpan'
    [Trace] : Enter text 'abc' in 'Text'
    [Trace] : SetText:([Element: 'input:1']) - Text:
    [Trace] : ScrollToVisible:([Element: 'input:1']) - ElementTopAtWindowTop
    [Trace] : MouseClick:LeftDown (1083,394)
    [Trace] : MouseClick:LeftUp (1083,394)
    [Trace] : MouseClick:LeftClick (1083,394)
    [Trace] : IF (Verify 'InnerText' 'StartsWith' 'Showing 0' on 'TableUsersInfoDiv') THEN
    [Trace] : Comment: else do nothing
    [Trace] : Closing Window

    Nigel Edwards, Transition Computing.

    PS - this thread was originally posted as http://www.telerik.com/automated-testing-tools/community/forums/test-studio/general-discussions/test-list-skips-over-execution-code.aspx, but it failed to be searchable, so is reposted here.
  2. Anthony
    Anthony avatar
    19 posts

    Posted 29 Mar 2012 Link to this post

    Hello Nigel,

    My colleague Ivalyo gave your first post priority and responded to you there. Let's continue the discussion in that thread to prevent a duplication of efforts. This post can remain as a link to the original.

    Kind regards,
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Nigel
    Nigel avatar
    53 posts
    Member since:
    Jan 2012

    Posted 10 Apr 2012 Link to this post

    okay, thanks Anthony.  :)
Back to Top