This question is locked. New answers and comments are not allowed.
I am having a hard time using the extract feature. I was testing it on the silverlight demo on telerk's site at the following url: http://demos.telerik.com/silverlight/#GridView/Totals
I am trying to extract the sum value in the bottom summary column and then verify that value against the new sum when I refresh the page. However, the name of the textfield is different each time I visit the page so the extraction fails. Is there anyway to get this to work everytime?
This is the code for my test.
//
public void a6_Add_Item()
{
// Launch an instance of the browser
Manager.LaunchNewBrowser();
// Navigate to : 'http://demos.telerik.com/silverlight/#GridView/Totals'
ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#GridView/Totals");
// Wait for '3000' msec.
System.Threading.Thread.Sleep(3000);
// Extract 'x532995Textblock' text into DataBindVariable $(sum)
// Navigate to : 'http://demos.telerik.com/silverlight/#GridView/Totals'
ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#GridView/Totals");
// Wait for '3000' msec.
System.Threading.Thread.Sleep(3000);
// Verify 'x532995Textblock' text Same '$5,329.95'
Assert.IsFalse((ArtOfTest.Common.CompareUtils.StringCompare(Pages.TelerikGridViewFor.SilverlightApp.x532995Textblock.Text, ((string)(System.Convert.ChangeType(TestContext.DataRow["sum"], typeof(string)))), ArtOfTest.Common.StringCompareType.Same) == false), string.Format("Verify \'x532995Textblock\' text Same \'$5,329.95\' failed. Actual value \'{0}\'", Pages.TelerikGridViewFor.SilverlightApp.x532995Textblock.Text));
}
I am trying to extract the sum value in the bottom summary column and then verify that value against the new sum when I refresh the page. However, the name of the textfield is different each time I visit the page so the extraction fails. Is there anyway to get this to work everytime?
This is the code for my test.
//
public void a6_Add_Item()
{
// Launch an instance of the browser
Manager.LaunchNewBrowser();
// Navigate to : 'http://demos.telerik.com/silverlight/#GridView/Totals'
ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#GridView/Totals");
// Wait for '3000' msec.
System.Threading.Thread.Sleep(3000);
// Extract 'x532995Textblock' text into DataBindVariable $(sum)
// Navigate to : 'http://demos.telerik.com/silverlight/#GridView/Totals'
ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#GridView/Totals");
// Wait for '3000' msec.
System.Threading.Thread.Sleep(3000);
// Verify 'x532995Textblock' text Same '$5,329.95'
Assert.IsFalse((ArtOfTest.Common.CompareUtils.StringCompare(Pages.TelerikGridViewFor.SilverlightApp.x532995Textblock.Text, ((string)(System.Convert.ChangeType(TestContext.DataRow["sum"], typeof(string)))), ArtOfTest.Common.StringCompareType.Same) == false), string.Format("Verify \'x532995Textblock\' text Same \'$5,329.95\' failed. Actual value \'{0}\'", Pages.TelerikGridViewFor.SilverlightApp.x532995Textblock.Text));
}