How to handle a ZipCode element with masking in Browserplayback

In my Browser playback, i have an element Employer Zip code and the format in html is as below
When it was recorded, it recorded as below. When playing back its able to find the element but doesn't type anything in the text box. I even tried to parameterized the field, added additional wait time. Still its unable to type the value in the text box.
Note-When running the test separate sometimes it types in the value, mostly types empty value.
Answers
-
Try adding a Click action before the Type action?
0 -
@benken_parasoft Tried it, didn't work.
0 -
You can work around this issue by adding 5-9 KeyDown Browser Testing Tools with values for each number you want to enter using the number pad. For example, to type 12345 you would include 5 KeyDown Browser Testing Tools whose Text Input are NUMPAD1, NUMPAD2, NUMPAD3, NUMPAD4, NUMPAD5 respectively.
This is understandably cumbersome, but it appears a resolution to this issue with the "Type" action would require a product update.
Note that if you are also running into this issue in a Selenium/Selenic test, you can work around it by changing any WebElement.sendKeys calls to something like:
Actions act = new Actions(driver);
act.sendKeys(myZipElement, "12345").build().perform();0