question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

input text sometimes doesn't send all the keys (revisited)

See original GitHub issue

It seems we are seeing the symptom reported by closed issue #1285. As requested in the original issue, I’ve attached a log file with --loglevel trace in effect. Here are the details…

When we try to use RobotFramework+SeleniumLibrary under Chrome, we lose characters that are sent to the web page as input text. Here’s a simple example robot script that produces the symptom for us:

*** Settings ***
Documentation     Simple example using SeleniumLibrary.
Library           SeleniumLibrary

*** Variables ***
${BROWSER}        headlesschrome

*** Test Cases ***
My Test
    Open Browser        https://www.duckduckgo.com  ${BROWSER} 
    Set Selenium Speed  1s
    Input Text          search_form_input_homepage  This is a test
    Click Button        search_button_homepage
    Sleep               5s
    Title Should Be     garbage to force failure for screenshot
    [Teardown]          Close Browser

*** Keywords ***

This should cause the web page to search for “This is a test”. However, only “Thi” makes it across to the web page (see attached screenshot).

We are running on Ubuntu 18.04 with the following:

$ apt list 2> /dev/null | grep google-chrome
google-chrome-beta/stable 76.0.3809.62-1 amd64
google-chrome-stable/stable,now 75.0.3770.100-1 amd64 [installed]
google-chrome-unstable/stable 77.0.3833.0-1 amd64
$ apt list 2> /dev/null | grep selenium
libtest-www-selenium-perl/bionic,bionic 1.36-2 all
python-selenium/bionic,bionic 3.8.0+dfsg1-3 all
python3-selenium/bionic,bionic 3.8.0+dfsg1-3 all
$ pip list 2> /dev/null | grep selenium
robotframework-selenium2library (3.0.0)
robotframework-seleniumlibrary (3.3.1)
selenium (3.141.0)

There are some rather baffling details:

  • We see the identical symptom with both chrome and headlesschrome.
  • The same robot under firefox works perfectly.
  • We do not see the symptom (on any browser) if we are logged onto the system locally or if we use ssh+X11 forwarding to another Linux system.
  • We do see the symptom consistently on Mac machines using ssh+X11 forwarding to XQuartz.

If the problem were with XQuartz, we would expect the same symptom regardless of browser. If the problem were with the chrome/headlesschrome drivers, we would expect the same symptom when the X server is on Linux. The fact that others have seen the same symptom (issue #1285) has us looking here first.

Any ideas?

chrome_issue_screenshot chrome_issue.log

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
reyeltscommented, Aug 6, 2019

I spent more time playing around with this. Using the simple login page to obviate login issues, I tried the following:

  • I changed formelement.py so _input_text_into_text_field() sends one character at a time (and added trace records to prove it). That had no effect… I get the same result as sending the whole string at once.

  • I tried changing “This is a test” to “tttt tt t tttt” (same string format… just all t’s). All of the t’s made it, but the spaces did not. It is almost as if something is seeing some of the characters as special.

  • I switched the X server from XQuartz (Mac) with port forwarding over ssh to instead use xvfb locally on the Linux machine (where Robot Framework+SeleniumLibrary are running). Success.

Since GeckoDriver/Firefox doesn’t exhibit the symptom, it would appear the problem is with ChromeDriver. At least for my case, it simply doesn’t play well with the X Server (XQuartz) and port forwarding over ssh on Mac. I did some poking around on their bug tracking site and found this:

https://bugs.chromium.org/p/chromedriver/issues/detail?id=2859&q=xquartz&colspec=ID Status Pri Owner Summary

So, I’m going to follow that path and see where it goes.

@aaltat, thanks for your help and pointers.

0reactions
aaltatcommented, Aug 7, 2019

No problems, glad that I could assist you in to the right direction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Selenium Send Keys function does not input text
I'm trying to fill a field with text inputs from a CSV, Send Keys works fine with all fields except for the below...
Read more >
sendKeys() not working in Selenium Webdriver - Tutorialspoint
If we encounter issues while working with the sendKeys method, then we can use the JavaScript Executor to input text within an edit...
Read more >
keydown and keyup events do not have proper keyCode (it's ...
Keypress events are not firing at all, and keydown/up events are returning incorrect characters, whether using keycode or charcode. The only choice I...
Read more >
URGENT: Text entry boxes not allowing input
The user is completely stuck, since we require input to move ahead. It seems to happen in FireFox and Safari, but not IE10....
Read more >
Risking Ourselves in Education: Qualification, Socialization ...
A key problem with the language of learning is that it tends to make these ... Whereas some would argue that this is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found