Skip Navigation LinksHome / Community / Forums / Test Studio: General Discussions > Test the rang

Not answered Test the rang

Feed from this thread
  • Talal avatar

    Posted on Feb 21, 2012 (permalink)

    Hi there,

    I need to test the range of Textblock, say for example I need to test the contains of the Textblock should be within the range (0 to 999999), how I do that? any example?

     

    Also how I check for negative value

    Your help and support much apprecialted

    Talal

    Reply

  • Ivaylo Ivaylo admin's avatar

    Posted on Feb 27, 2012 (permalink)

    Hello Talal,

    Please excuse me for the delayed reply.

    Unfortunately you cannot perform such a verification only by using the Test Studio menu. You can do that using coded step. I am providing you the code example below:

    int minValue = 0;
    int maxValue = 999999;
    TextBlock tb = Pages.TelerikDataFormFor.SilverlightApp.PARTLabelTextblock;
    Log.WriteLine(tb.Text);
    int value = Int32.Parse(tb.Text);
     
     
    Assert.IsTrue((value >= minValue)&&(value <= maxValue));
     
    // Verify Item3Textbox.MaxLength 'LessThanOrEqual' '999999'
    //Assert.IsTrue(ArtOfTest.Common.CompareUtils.NumberCompare(Pages.TelerikDataFormFor.SilverlightApp.Item3Textbox.MaxLength, 999999, ArtOfTest.Common.NumberCompareType.LessThanOrEqual), "Property does not satisfy constraint");

    Should you have any additional questions please let us know. Greetings,
    Ivaylo
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings

    Reply

  •   Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!

Back to Top

Skip Navigation LinksHome / Community / Forums / Test Studio: General Discussions > Test the rang
Related resources for "Test the rang"

Test Studio Features  |  Documentation |  Videos  |  Webinars  |  Automated Testing Tools  ]