How to handle InpuutMask tag in jsf to set value from Robot framework automation testing using selenium2Library?

I’m beginner of automation testing using robot framework with RED IDE. I try to set the phone number and NRIC number from robot framework. However, those two are using InputMask tag and mask attribute eg:<p:InputMask mask=“99999999”>.

Robot FW code:

Input Text //input[@name=“nric”] A12345678B
Sleep 2s
Input Text //input[@name=“ph”] 98765432

When I run the automation testing from RED IDE, it can run but can’t type correctly sequence of giving value. For example, the automation testing for phone input box typing like this “4329876” or “6543298”. Can’t type the giving value correctly. Could you please suggest how to continue the testing for those InputMask tag? Thank you for your help.

Hi Amy,

Firstly don’t use Selenium2Library, it out of date, use SeleniumLibrary

It appears what is happening is your site is applying validation code as the text value is being input.

First thing I would suggest trying is Press Keys as this simulates typing so might work better with your website’s validation .

If that doesn’t help i’ll see what else I can find for you.



Amy, what version of Robot Framework are you using? Because as things stand right now, RED is not compatible with version 4.0 of Robot Framework so keep that in mind. Especially if you are new to all this. I know the folks for RED are working on it but it’ll take some time.

And as Dave advises, you should switch over to using Selenium Library instead.

1 Like