Forum Discussion
Depends on a couple of things:
1. The country you're talking about. Can't be the UK if it's 6 digit numeric. UK is Alpha + Numeric and if you want to validate your input, a big horrible regex is about as good as it gets.
2. Are you 100% controlling the test data? Or are you writing something other people can populate and use thus you need to validate their input data. If you're the one in control, then this is a simple test and the answer from baxatob should be sufficient. (Although I would probably add a check for leaving it blank ...)
- Marsha_R8 years agoChampion Level 3
I would add the =6 digits case, since that's the actual requirement.
- shilpi_agarwal8 years agoContributor
My question is -
Since i am hard coding the postal code in my script. Is this correct way to use hardcode the value of postal code in the script?
if aqConvert.VarToStr(Driver.Value(6)) = "123" then
Here I am checking the postal code value with the excel file's postal code and compare the expected output(in excel file) with the actual output(application output)
- Marsha_R8 years agoChampion Level 3
That will work but it would be a more generic test to look at the length of the string instead of the contents.
Take a look at aqString.Compare
https://support.smartbear.com/viewarticle/87967/
You can check the numeric requirement separately.
Related Content
Recent Discussions
- 3 hours agoSvetaG