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

Test the rang

1 Answer 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Talal
Top achievements
Rank 1
Talal asked on 22 Feb 2012, 02:50 AM
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

1 Answer, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 27 Feb 2012, 07:18 PM
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
Tags
General Discussions
Asked by
Talal
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Share this question
or