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

Mandatory fields validation

6 Answers 190 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tiago
Top achievements
Rank 2
Tiago asked on 25 Mar 2015, 05:47 PM
Hi,

Is there any way to validate the required fields on a form made ​​in angularjs?

there is no alert window only the outline of the label changes color

6 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 27 Mar 2015, 09:18 PM
Hi Tiago,

The way your inquiry is written "Is there any way to validate the required fields on a form made ​​in angularjs?" sounds more like something a developer would ask i.e. how do I do field valication in my AngularJS application.

Since this is the Telerik Test Studio public forum, did you mean how do you get Test Studio to validate these input fields? I will assume this and do my best to answer.

First Test Studio has no way of knowing which input fields are mandatory and which are not. It can only see what's present in the browsers DOM and this information is not present in the DOM. Only the web application (i.e. the code) has this information.

As far is validating, there are many different forms of validating. If you can concretely specify what validation you want Test Studio to perform on each field, then I can help you in designing a test script to do just that. Just saying "validate the required fields" is too vague and ambiguous to be able to provide a concrete answer.


Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Tiago
Top achievements
Rank 2
answered on 30 Mar 2015, 10:09 AM
I need validate riquired fields like this:

(the form was developed in angularJS)
0
Tiago
Top achievements
Rank 2
answered on 30 Mar 2015, 10:10 AM
like this
0
Cody
Telerik team
answered on 30 Mar 2015, 04:33 PM
Hi Tiago,

Thank you for the screen shot. I see the form and the error messages in red. Now we need to more concretely define what exactly about this form do you want Test Studio to validate. That the error message appears? That the text is red? Or something else? Once we spell out exactly what is to be validated on this form then we can put together a test script that performs those steps.


Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Tiago
Top achievements
Rank 2
answered on 30 Mar 2015, 05:14 PM
Hi,

I need to validate the required fields are filled . If they are not filled need to know that not eestão completed and what are the fields where it happens .
0
Cody
Telerik team
answered on 30 Mar 2015, 08:29 PM
Hello Tiago,

Test Studio can only test one input field at a time. Verifying that an input field is not empty requires one line of code, like this:

Assert.IsTrue(Pages.TryitEditorV230.FrameIframeResult.Text.Value.Length > 0);

You will need to design a test that has N verifications like this, where N is the number of input fields you want to validate. I've attached a sample test as a demonstration.

Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Tiago
Top achievements
Rank 2
Answers by
Cody
Telerik team
Tiago
Top achievements
Rank 2
Share this question
or