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

Overriding a control's type?

3 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sander
Top achievements
Rank 1
Sander asked on 17 Sep 2014, 09:27 AM
Hi,

I'm creating a test in which I run through a registration form, part of this registration form is the email adres field. This field is mapped to a Telerik control, and the Telerik framework has made it a "HtmlInputText". This results in an error, I imagine because when it looks for this control the type is "type=email", either way it gives me the following exception: Invalid input type "Email'' for this control. Control was expecting ''Text"

This is fixed whenever I change the control's type to HtmlInputEmail, however because the pages.g.cs is auto regenerated everytime you build, the Telerik framework automatically changes this back to HtmlInputText which breaks the test. How can I manually force it to generate this as a HtmlInputEmail? Also I suppose this can be seen as a bug report of sorts, because the "type=email" is even included in the control's find parameters, how does the framework not properly create this as an HtmlInputEmail?

Regards,
Sander

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 22 Sep 2014, 08:09 AM
Hello Sander,

We do have similar feedback logged, which you can review it using this public URL, however this has not being implemented yet.

Is there any way you can provide us with access to the registration form and a sample test you are executing so we can have a repro and investigate further? The idea here is after we have a repro to provide you with a suitable workaround if possible.

Thank you for your cooperation in advance.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Sander
Top achievements
Rank 1
answered on 02 Oct 2014, 11:57 AM
Hi Ivaylo,

the problem lies in this control:

public ArtOfTest.WebAii.Controls.HtmlControls.HtmlInputText MobileRegistration_Email
            {
                get
                {
                    return Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlInputText>("tagname=input", "id=ctl00_Email", "type=email", "name=ctl00$Email");
                }
            }


As you can see the type is specified as Email in the search criteria, but it still creates the control as a "HtmlInputText" instead of an "HtmlInputEmail" type.

Regards,
Sander






0
Ivaylo
Telerik team
answered on 07 Oct 2014, 07:46 AM
Hello Sander,

The only case you may experience this is if you have recorded this on one browser and executing it on another. For example if you recorded the test on IE11 and you are executing on IE10. If you are executing on the same browser that you used for recording then we definitely need to get a repro in order to investigate further. We tried to use a public available sites such as gmail and we were not able to. If you can provide us with access to your application this will be great.

In case you cannot provide reliable repro and until this is successfully reproduced on our end you can use the following coded workaround. Find the element in code and set the appropriate text/email:

Actions.SetText(Manager.ActiveBrowser.Find.ById("ctl00_Email"), "email@email.com");

Thank you for your understanding and cooperation.

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