Validating a textbox input.
I have to validate a textbox that it should not contains only letters or alphabets or special character. It should be alphanumeric. Being new to selenium webdriver, I cam not able to write script forit. Please help
For example, it should not be AAA AA, 123 5678, £$$ $%^ or combination of all.
It should be a proper UK post code.
Reg. UK Post-codes, I will suggest following way:
1. Using selenium driver.getAttribute(“value”) / driver.getText() [whichever appropriate in your situation];
read the submitted value, may be store the string somewhere.
2. Now, instead of writing whole regEx validation algorithm yourself.
Using other driver open any of the public available website providing postcode validation (**Make sure you don’t flood external site & use considerably & appropriately ) ;
Go to postcode text field.
> Enter pCode reterived in step-1
> Put into their post-code field & search
> Check if correct result is returned.
3. continue accordingly.