compare two values

2 posts, 0 answers
  1. Maria
    Maria avatar
    4 posts
    Member since:
    Oct 2011

    Posted 08 Nov 2011 Link to this post


    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,
  2. Stoich
    Stoich avatar
    1 posts

    Posted 11 Nov 2011 Link to this post

    Hello Maria,
         it's going to be possible to find the problem without additional info. Please check out this video:

    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
Back to Top