Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to handle a ZipCode element with masking in Browserplayback

tthiyagarajan
tthiyagarajan Posts: 2
edited March 5 in SOAtest

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

  • benken_parasoft
    benken_parasoft Posts: 1,322 ✭✭✭

    Try adding a Click action before the Type action?

  • tthiyagarajan
    tthiyagarajan Posts: 2

    @benken_parasoft Tried it, didn't work.

  • tony
    tony Posts: 34 ✭✭

    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();