Hi,
Two weeks ago I started to use WebAii for Silverlight Automation testing. This application is developed in SL 4 and it contains even some custom controls (ie. masek text boxes). Until now I didn't find a solution to identify and type and value in them. Those controls are not derived from text box controls , are delivered directly from controls lib so:
I identified them in this way:
- Control textBox = app.FindName<Control>("textBoxName");
I tried to fill them in different ways without any result:
- textBox.User.TypeText("1234as", 500, true);
- textBox.SetProperty(new AutomationProperty("Text", typeof(string)), "1234as");
The problems is that the masked text boxes are still empty even if the property was set correctly (I verified)
I used the second statement: "textBox.SetProperty ..." for a normal text box and it has been filled normally.
Could you please help me to solve this issue ?
7 Answers, 1 is accepted
All elements in a Silverlight application are FrameworkElement's. Try code like this:
FrameworkElement elem = app.Find.ByExpression(
new
XamlFindExpression(
"Name=textBoxName"
));
elem.User.TypeText(
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
, 20);
Cody
Thank you very much for your answer.
I tried to implement your solution but still the masked text box remains empty. A horizontal line appears for a while in the bottom of the field, when “the unit test” tries to fill the masked textbox. After that the line disappears and the field remains empty L
Do you have another idea for this issue ?
Thank very much in advice :) and have a nice weekend
Best regards,
Mircea-Bogdan Sicoe
I apologize for the delay getting back to you. The volume of technical support requests has been overwhelming lately.
I am unable to repro this problem using our masked text box located on our demo page. Can you point me to a website I can access to see and study this problem? Or can we look at this together in a GoToMeeting?
Cody
I'm not able to give you a link to the website which I'm testing. Those masked text boxes which I'm testing are created by Syncfusion.
Below I put you a link with some masked textboxes created by Syncfusion
http://samples.syncfusion.com/sfmvcsamplebrowser/8.3.0.21/MVC/Tools_MVC/Samples/4.0/commoneditor/maskedtextbox
I hope that you will be able to reproduce my problem with those text boxes
Best regards,
Mircea-Bogdan Sicoe
I am still unable to reproduce any problems. I have attached a video showing it playing on my machine, along with the test and data file I used. Would you like to look at this together via GoToMeeting?
Best wishes,Cody
Thank you very much for your answer and video.
Right now I'm a bit busy with other things but within a few days I will back to the automation tests. I will come back to you after I return to the automation tests.
Thank very much and have a nice week
Best regards,
Mircea-Bogdan Sicoe
No problem. We'll be here when you are ready to pick this back up.
Regards,
Cody
the Telerik team