Test the rang

2 posts, 0 answers
  1. Talal
    Talal avatar
    19 posts
    Member since:
    Jan 2012

    Posted 21 Feb 2012 Link to this post

    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
  2. Ivaylo
    Admin
    Ivaylo avatar
    781 posts

    Posted 27 Feb 2012 Link to this post

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