Completed
Last Updated: 01 Oct 2013 13:08 by ADMIN
ADMIN
Cody
Created on: 06 Aug 2013 21:52
Type: Bug Report
0
Default friendly name of Silverlight app not persisted
When you record a Silverlight application, the names of the Silverlight app nodes shown in the Elements Explorer are not persisted into the .tstest file. This can result in random name changes (SilverlightApp to SilverlightApp0 to SilverlightApp1, etc.) depending on adding tests, renaming tests, etc. If the names randomly change, then code that relies on stable names will randomly fail with an error like "xxxxx.tstest.cs(56,42): error CS1061: 'xxxx.Pages.xxxx.SilverlightAppElement' does not contain a definition for 'LoginUserNameBoxTextbox' and no extension method 'LoginUserNameBoxTextbox' accepting a first argument of type 'xxxx.Pages.xxxx.SilverlightAppElement' could be found (are you missing a using directive or an assembly reference?)". The .tstest file only contains this:

      <d2p1:FindExpression>
        <d2p1:BackupSearchClause>/popup[1]/loginwindow[1]/grid[1]/grid[2]/border[5]/border[1]/grid[1]/border[2]/contentpresenter[1]/grid[1]/textbox[1]</d2p1:BackupSearchClause>
        <d2p1:DataBindingExpressions xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
        <d2p1:FindExpressions xmlns:d5p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
          <d5p1:KeyValuePairOfTechnologyTypeanyTypeHXKb0FV5>
            <d5p1:key>Html</d5p1:key>
            <d5p1:value i:type="d2p1:HtmlFindExpression">
              <d2p1:ChainStops xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
              <d2p1:Clauses>
                <d2p1:HtmlFindClause>
                  <d2p1:Clause>id=silverlight</d2p1:Clause>
                </d2p1:HtmlFindClause>
                <d2p1:HtmlFindClause>
                  <d2p1:Clause>tagname=object</d2p1:Clause>
                </d2p1:HtmlFindClause>
              </d2p1:Clauses>
              <d2p1:Constraints />
            </d5p1:value>


If you deliberately change the friendly name of the Silverlight app node, then that friendly name does get persisted to the .tstest file like this:

      <d2p1:FindExpression>
        <d2p1:BackupSearchClause>/popup[1]/loginwindow[1]/grid[1]/grid[2]/border[5]/border[1]/grid[1]/border[2]/contentpresenter[1]/grid[1]/textbox[1]</d2p1:BackupSearchClause>
        <d2p1:ContainerName>MySilverlightApp0</d2p1:ContainerName>
        <d2p1:DataBindingExpressions xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
        <d2p1:FindExpressions xmlns:d5p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
          <d5p1:KeyValuePairOfTechnologyTypeanyTypeHXKb0FV5>
            <d5p1:key>Html</d5p1:key>
            <d5p1:value i:type="d2p1:HtmlFindExpression">
              <d2p1:ChainStops xmlns:d8p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
              <d2p1:Clauses>
                <d2p1:HtmlFindClause>
                  <d2p1:Clause>id=silverlight</d2p1:Clause>
                </d2p1:HtmlFindClause>
                <d2p1:HtmlFindClause>
                  <d2p1:Clause>tagname=object</d2p1:Clause>
                </d2p1:HtmlFindClause>
              </d2p1:Clauses>
              <d2p1:Constraints />
            </d5p1:value>

Note the new ContainerName element.
1 comment
ADMIN
Daniel Djambov
Posted on: 01 Oct 2013 13:08
Telerik: This is how Test Studio currently works. The two tests have different expression for the Silverlight app element and this is reason that they are not merged. If both Silverlight pages have same find logic they will merge and the issue will not be present. Will be considering better usability improvement in future regarding notifying user in such scenarios.