Telerik Forums
Test Studio Forum
2 answers
102 views
Hi,

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">
</WebAppPhysicalPath>
<EnableScriptLogging Type="System.Boolean">True</EnableScriptLogging>
<EnableUILessRequestViewing Type="System.Boolean">False</EnableUILessRequestViewing>
<LocalWebServer Type="ArtOfTest.WebAii.Core.LocalWebServerType">None</LocalWebServer>
<BaseUrl Type="System.String">
</BaseUrl>
<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 />
</WebSettings>
<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>
</Settings>
<Tests>
<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>
</Item>
</Tests>
<Filter Type="ArtOfTest.WebAii.Design.Execution.Filter" Version="2011.2.1413.0">
<Keys />
<Comparisons />
<Values />
</Filter>
<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 1.9.0.11 ***
[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


Thanks,
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.
Nigel
Top achievements
Rank 2
 answered on 10 Apr 2012
4 answers
113 views
Hi,

Yesterday I posted "Test List 'skips over' execution code" to the forum.  The link is:
http://www.telerik.com/automated-testing-tools/community/forums/test-studio/general-discussions/test-list-skips-over-execution-code.aspx

If I search for 'nigel edwards' all my posts except the above are found.  Why not this one?

I can click on the link and find the post, but searching for the post doesn't locate it.  Any ideas?

Thanks,
Nigel Edwards, Transition Computing
Nigel
Top achievements
Rank 2
 answered on 10 Apr 2012
5 answers
56 views
I have following object on my page:
http://screencast.com/t/z66xIoROx
If I run test with step "click" this object and "Toggle Annotation" is on - test performs successfully.
If "Toggle Annotation" is off - click on this object works incorrectly - adjacent button is clicked and test failed.
Ivaylo
Telerik team
 answered on 09 Apr 2012
1 answer
185 views
I want to extract some coded steps from my test to use it by different tests. These coded steps work with variables defined in test and these variables are different in different test.
// define variable
public static string accountEmailDomain = DateTime.Now.ToString("yyMMddHHmmss") + ".com";
 
 
// use it in code
[CodedStep("Enter text in 'Account_EmailDomain'")]
public void Fill_AccountEmailDomain1()
{
  Pages.AccountWindow.FrameContentIFrame.Account_Emaildomain.MouseClick();
  Manager.Desktop.KeyBoard.TypeText(accountEmailDomain, 50, 100);
}
I want to extract CodedStep to separate test, but how I could pass variable 'accountEmailDomain' from current running test?
I only guess to do it like
// use it in separate test
[CodedStep("Enter text in 'Account_EmailDomain'")]
public void Fill_AccountEmailDomain1()
{
  Pages.AccountWindow.FrameContentIFrame.Account_Emaildomain.MouseClick();
  Manager.Desktop.KeyBoard.TypeText(Test1.accountEmailDomain, 50, 100);
}
but I need to pass testname to this separate test.

Please suggest.
Stoich
Telerik team
 answered on 06 Apr 2012
2 answers
130 views
I have following data grid with many rows in it which are like following
<tr class="ms-crm-List-Row" otype="9005" oid="{EF80BD25-B979-E111-8FE2-00155D282904}" statecode="Completed" operationtype="10">
<TD class=ms-crm-List-DataCell align=center><INPUT id=checkBox_{EF80BD25-B979-E111-8FE2-00155D282904} class=ms-crm-RowCheckBox title="Cell_1" tabIndex=0 value="" type=checkbox></TD>
<TD class=ms-crm-List-DataCell align=center><IMG alt="" src="/_imgs/ico_16_9005.gif?ver=1339846006"></TD>
<TD class=ms-crm-List-DataCell><NOBR title="Cell_2"><A id=gridBodyTable_primaryField_{EF80BD25-B979-E111-8FE2-00155D282904}_0 class=ms-crm-List-Link title="Cell_2" tabIndex=0 href="#" target=_self>Cell_2</A></NOBR></TD>
<TD class=ms-crm-List-DataCell><NOBR>
<LI style="DISPLAY: inline"><SPAN class=gridLui title=Cell_3 ondblclick=clearTimer() contentEditable=false onclick=handleGridClick() otype="2" oid="{0EF8471E-B979-E111-8FE2-00155D282904}"><IMG id=ico_16_2 class="ms-crm-ImageStrip-ico_16_2 ms-crm-Lookup-Item" alt="" src="/_imgs/imagestrips/transparent_spacer.gif">Cell_3</SPAN></NOBR></LI></TD>
<TD class=ms-crm-List-DataCell><NOBR>Cell_4</NOBR></TD>
<TD class=ms-crm-List-DataCell><NOBR><A style="CURSOR: hand" id=gridBodyTable_lookup_{EF80BD25-B979-E111-8FE2-00155D282904}_0 class=ms-crm-List-Link title="Cell_5" tabIndex=0 onclick=handleLookupAnchorClick() href="#" target=_self>
<LI style="DISPLAY: inline"><SPAN class=gridLui title="Cell_6" ondblclick=clearTimer() contentEditable=false onclick=handleGridClick() otype="8" oid="{36D460BF-1940-E111-A0D7-00155D282904}">Cell_6</SPAN></A></NOBR></LI></TD>
<TD class="ms-crm-List-DataCell ms-crm-NumbersAndDates"><NOBR>Cell_7</NOBR></TD>
<TD class="ms-crm-List-DataCell ms-crm-NumbersAndDates">Cell_8</NOBR></TD>
<TD class=ms-crm-List-DataCell> </TD>
To handle it I should click on cell with title "Cell2"(but this ID have all rows in table).
Rows differ each other by value in Cell_3.

Please suggest how I could define row with proper 'Cell_3' value and click call with Cell_2 value?
algot
Top achievements
Rank 1
 answered on 05 Apr 2012
2 answers
131 views
Hi

I have a datagrid/table where for each row (except the header) there are some hidden values, some showng info and a button.

What I'm wanting to do is loop through the rows and find in the first column the values in 2 hidden fields.  If hidden1 and hidden2 match datavalue1 and datavalue2 then I can find the correct rowindex and therefore find the correct button to click.

I can successfully loop through the rows of the table, but i'm not sure how to find the value of the hidden fields for EACH row as I loop through.

I can find it on the page using

Dim cpolicy As HtmlInputHidden = Pages.TravelInsuranceSalesSystem1.Get(Of HtmlInputHidden)("id=ctl00_ContentPlaceHolder1_TestGrid_ctl02_cpolicy")


but not for each cell as I'm unsure how to refer to a partial ID for a hidden field.

This is what I have so far, the htmlinputhidden is incorrect:

For Each r As HtmlTableRow In Pages.TravelInsuranceSalesSystem1.ContentPlaceHolder1TestGridTable.AllRows
               if r.RowIndex <> 0 then
       'ignore the header row
                   For Each c As HtmlTableCell In r.Cells
                        
                           if c.CellIndex = 0 then
                           'column 1 only
                                    
                               Dim cpolicy As HtmlInputHidden = c.Get(Of HtmlInputHidden)("id=~cpolicy")
                                
                               if cpolicy.Equals("TI") then
                                   Log.WriteLine("cpolicy:" & cpolicy.Value )
                               end if
                           end if
                   Next
               end if
           Next
Anthony
Telerik team
 answered on 04 Apr 2012
3 answers
841 views
Hi, 

Is it possible that I single step through my coded step?

thx

Anthony
Telerik team
 answered on 04 Apr 2012
8 answers
185 views
Hello

Is it possible to set up a databind using T-SQL where a filtering value will be from another dataset?

Eg
datasetA = login info
datasetB = product info

So, once logged in for each interation in datasetA, I need to be able to pass an ID value from datasetA to datasetB which is attached to a Test as Step.

I ultimately will need to loop through the tests for multiple logins and in turn for multiple products


Thanks for your help
Cheryl
Anthony
Telerik team
 answered on 04 Apr 2012
1 answer
128 views
Hi team,
i met an issue about cookie today. In my web application, there is a debug page("http://wwwqa.inventory.ford.com/debug/cookies.jsp") to add a cookie with name "dealerPooling" and value "true", if i add this cookie, then a proper page will display.
My version of  telerik test studio is 2011.2.1413.0

scenario 1:
     step1: turn to "http://wwwqa.showroom.ford.com/FDShowroom.jsp?makeTransition=inventory"
     step2: click on FIESTA image
     step3: input a zipcode(48033) to zipcode input textbox and click "SEARCH DEALER INVENTORY" button
     step4: A search dealer inventory page for this scenario1 will display

scenario 2:
     turn to a debug page "http://wwwqa.inventory.ford.com/debug/cookies.jsp" and add a cookie with name "dealerPooling" and value "true"
     repeat steps in scenario2, and we can see a different search dealer inventory page for this scenario2.

What i want to know is how to add cookie with code steps?
I have tried several ways to do that, but failed, only scenario1 page displayed when i execute scenario2 step, here is some code to be invoked before clicking "SEARCH DEALER INVENTORY"

1.
Public Sub SetCookie()
            Dim newCookie As New System.Net.Cookie()
            newCookie.Name = "dealerPooling"
            newCookie.Value = "true"
            newCookie.Domain = "http://wwwqa.inventory.ford.com"
            newCookie.Expires = DateTime.MaxValue
            ActiveBrowser.Cookies.SetCookie(newCookie)

End Sub

2.
Public Sub SetCookieWithDebugPage()
            ActiveBrowser.NavigateTo("http://wwwqa.inventory.ford.com/debug/cookies.jsp")
            
            Dim nameBox, valueBox As HtmlInputText
            Dim submitButton As HtmlInputSubmit
            
            nameBox = Find.ByAttributes(of HtmlInputText)("name=newName")
            valueBox = Find.ByAttributes(of HtmlInputText)("name=newValue")
            nameBox.Text = "dealerPooling"
            valueBox.Text = "true"
            submitButton = Find.ByAttributes(of HtmlInputSubmit)("name=addCookie")
            submitButton.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
            submitButton.Click
End Sub
Anthony
Telerik team
 answered on 03 Apr 2012
1 answer
99 views
Hi,

How to show debug log while running the test, as opposed to "view log" after the whole test is done?

thx
Anthony
Telerik team
 answered on 03 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?