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

compare two values

1 Answer 138 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Maria
Top achievements
Rank 1
Maria asked on 08 Nov 2011, 12:08 PM
Hello,

I am trying to automate some tests on Test Sudio framework and now I'm having some problems.

I am trying to compare two values on diffrent grids. This values are dynamic so their different on each reproduction.

Here is the code that I am using right now and is not correct:

"        [CodedStep(@"Verify RootGrid1.Name 'Equal' 'Root'", RequiresSilverlight=true)]
        public void Req216_CodedStep()
        {
            // Verify RootGrid1.Name 'Equal' 'Root'
            Assert.IsFalse((ArtOfTest.Common.CompareUtils.StringCompare(Pages.HttpGlintthsdemo8700Shell.SilverlightApp.RootGrid1.Name, "Root", ArtOfTest.Common.StringCompareType.Exact) == false), string.Format("Verify RootGrid1.Name \'Equal\' \'Root\' failed.  Actual value \'{0}\'", Pages.HttpGlintthsdemo8700Shell.SilverlightApp.RootGrid1.Name));
            
        }
    
        [CodedStep(@"Verify RootGrid2.Name 'Equal' 'Root'", RequiresSilverlight=true)]
        public void Req216_CodedStep1()
        {
            // Verify RootGrid2.Name 'Equal' 'Root'
            Assert.IsFalse((ArtOfTest.Common.CompareUtils.StringCompare(Pages.HttpGlintthsdemo8700Shell.SilverlightApp.RootGrid2.Name, "Root", ArtOfTest.Common.StringCompareType.Exact) == false), string.Format("Verify RootGrid2.Name \'Equal\' \'Root\' failed.  Actual value \'{0}\'", Pages.HttpGlintthsdemo8700Shell.SilverlightApp.RootGrid2.Name));
            
        }
        
         [CodedStep(@"Verify RootGrid2.Name 'Equal' Verify RootGrid1.Name + 1", RequiresSilverlight=true)]
        public void Req216_CodedStep2()
        {
// the value of rootgrid2 needs to be the value on rootgrid1 +1
            int val2 = Convert.ToInt32(Pages.HttpGlintthsdemo8700Shell.SilverlightApp.RootGrid2.Text);
            int val1 = Convert.ToInt32(Pages.HttpGlintthsdemo8700Shell.SilverlightApp.RootGrid1.Text);
            int val_c = val1 + 1;
            
            // Verify RootGrid2.Name 'Equal' Verify RootGrid1.Name + 1
            Assert.AreNotEqual(val2, val_c);
            
        } "

What I am doing wrong?


Thank you.

Best regards,
Maria

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 11 Nov 2011, 10:28 AM
Hello Maria,
     it's going to be possible to find the problem without additional info. Please check out this video:
http://tv.telerik.com/watch/automated-testing-tools/test-studio-submitting-support-ticket-for-playback-issues

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
Tags
General Discussions
Asked by
Maria
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or