I am trying to set a textbox to the value of my SSN variable. This text box has a max length of 9.
The page wants the data to be formatted at as ###-##-####.
I formatted my variable to this format, however the textbox only allows 9 characters.
Anyway to trick the site to think I am typing this in.
What objects will accept the sendkeys method.
It's not associated with an object. It mimics an actual keyboard press. So you first need to click on/activate the object
Set wshShell = CreateObject("WScript.Shell")
More info in the help file for special keys and such.
You should not format the SSN and rather just type the normal one
Setting.WebPackage("ReplayType") = 2
Browser("").Page("").WebEdit("").Set Replace(varSSN, "-", "")
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **
Does the text automatically get aligned in case of such textfields. I have seen instances, where the text gets automatically formatted once we get to just type in the text.
Winds of Change
The SSN does not have the dashes.
I have tried adding the dashes but then its to big for the text box.
when I do just a set "123456789" the website wants the masking. If I click in the text box it shows "##-###-####" but then when I do a set it just over writes the mask.
what happens when you type manually? use the same format to do the set. is SSN 3 box or 1 box?
Its a 1 text box that has a max limit of 9.
When I click in the text box the mask of ##-###-#### shows up and as I type, the number signs are replaced. When QT Does the set, it over writes the mask as 123456789 which the website does not like.
U need to discuss with the dev team, because this involves the change to the text size set to the field.