Can't input text into the text field

894 views
Skip to first unread message

Bojan Cuturilo

unread,
May 6, 2021, 3:21:21 PM5/6/21
to robotframework-users
Hi all,
I'm new with the Robotframework and SeleniumLibrary.

Is there any way to Input Text into the phone field if the field value is prepopulated?

Field value is empty at first
<input name="phoneNumber" type="tel" placeholder=" " aria-required="true" id="phoneNumber" value="">,
but when i click on the element it becomes prepopulated 
<input name="phoneNumber" type="tel" placeholder=" " aria-required="true" id="phoneNumber" value="(___)___-____">
When I'm entering numbers manually it looks like value="(555)66_-____"
When I run the test with:
input text //*[@id="phoneNumber"] (555)666-7777
this field remains blank with prepopulated value (___)___-____ and I can't overwrite it.
I tried with ${EMPTY} at the end, try to Click Element first and then input text but still nothing :(

Thanks,
Bojan

Dave Amies

unread,
May 6, 2021, 8:34:48 PM5/6/21
to robotframework-users
Hi Bojan,

First you will want to determine what you are dealing with, is it:
1) a standard text input?
3) a span that is using css styling to look like an input field with a hidden input behind it?

Open the page in your browser and use dev tools to inspect the form field and see if it's one of the above or something different?

Input text is supposed to clear before entering the text anyway, so I don't think that was the issue.

I've never tried input text with a tel field so this might be the issue? but I don't expect this to be the case.

There is another option for entering text into a field with the Press Keys, did you try that?
`Press Keys    //*[@id="phoneNumber"]     (555)666-7777 

One more thing to consider, are you actually acting on the field you think you are? again using dev tools in the browser you can test the xpath by switching to the console tab and on the console type ` $x('//*[@id="phoneNumber"] ') ` and make sure that only returns 1 result, I think from memory if robot framework finds multiple results it actions on the first result.

Hopefully something here will put you on the path to finding your answer,

Dave.

Bojan Cuturilo

unread,
May 7, 2021, 5:20:31 AM5/7/21
to robotframework-users
Thank you Dave!!!

It works with Press Keys    //*[@id="phoneNumber"]     (555)666-7777

Thank you,
Bojan

Jirayu Kaewprateep

unread,
Jan 9, 2022, 6:36:58 AM1/9/22
to bojanc...@gmail.com, robotframework-users
I used to have problems when they had different ID with same name, specific ID for actual controls select some controls they are ready input last than textbox.
👉 It should works with correct dirvers and browsers mapping, sequence orders and condition.

🧸💬 The customize controls or includes loads later.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/1a29a27d-8e2b-42b3-baf5-d3c6e88a1245n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages