Feature request - ValidateNULL

Bug reports.
tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Feature request - ValidateNULL

Post by tsyingling » Thu Dec 08, 2011 5:20 pm

Are there any plans in the future to perhaps implement something like a ValidateNULL Action via the Recorder for text boxes, combo boxes, etc.? Right now we really haven't come up with anything better than duplicating the items in the repository we want to check, adding a [@text=null()] to the path and doing an Exists to the item with the path addition when null and a normal Validate of the item without the path when populated.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Feature request - ValidateNULL

Post by Support Team » Fri Dec 09, 2011 12:54 pm

Hi,

Do you have tried to use another unique attribute for identification than the "text" one?
As the text of an element can change, it is not the best attribute for identification purposes.
If you are able to use another one there shouldn't be any troubles with the validation of an empty textbox.

Regards,
Markus
Ranorex Support Team

tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Re: Feature request - ValidateNULL

Post by tsyingling » Fri Dec 09, 2011 7:09 pm

It's because the value changes that I don't use the @text to identify the field. Let's say there's one text box field. I'll identify the field as text[1]. If I type "abc" in the text field and then use recorder to Match Name Text to Match Value abc then it works fine. If I have nothing in the text box and use Match Name Text to Match Value null or blank or whatever, I get an error that actual is (null) and expected is whatever I try to put in there or don't put in there because the recorder doesn't recognize null since null is not really a text "Value". The best I could make out from your docs is that if just using the recorder/repository (and not just pointing to code in a usercode file) you have to create a repository entry of text[1][@text=null()] and then create a recording line of Exists for that repository entry when the text box is null. So I now have two repository items to validate the value, one so I can do a null check and the other (text[1]) to do a Attribute Equal Text when I have data. What I was hoping you could do for a future update if it was possible was to create a ValidateNull Action item in Recorder that you could select the item and property (like ValidateNull for property Text for item TextBox1) and the Recorder would know from that command to do an item[@property=null()] and that way I could use the same repository item definition I use for everything else or if I simply wanted to check if the defined item property was null. Hope that clears up what I was requesting. Thanks.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Feature request - ValidateNULL

Post by Support Team » Mon Dec 12, 2011 8:50 am

Hi,

I will talk to the developer team - I will come back on that. Meanwhile your workaround is working I think.
Would you please provide me information about the technology you are using, is it QT?

Thanks
Martin
Ranorex Support Team

tsyingling
Posts: 20
Joined: Wed Nov 04, 2009 5:18 pm

Re: Feature request - ValidateNULL

Post by tsyingling » Mon Dec 12, 2011 4:17 pm

Silverlight 4, data stored in SQL db

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Feature request - ValidateNULL

Post by Support Team » Tue Dec 13, 2011 5:07 pm

Hi,

your feature is on our feature list - we will discuss this.

Meanwhile, I have a workaround on that - you can do it within the code.
[*] Convert the validate action to user code (Right Click on the valiate action -> Convert to User Code and define a name for the method).
[*] View the user code (Right Click on the valiate action -> View User code)

The validate method should look something like this

Code: Select all

Validate.Attribute(repo.WebDocumentMarketsPlus_Evolve_Tradi.FormSilverlight_Control1.TextUsernameInfo, "Text", (string)null);
Regards,
Martin
Ranorex Support Team