Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Text keyword fails on specific letters when using chrome and exported display #1874

Open
brandoncraig-gtri opened this issue Dec 18, 2023 · 2 comments

Comments

@brandoncraig-gtri
Copy link

This issue may be related to #1873. The root cause of the issue may not be in Selenium Library at all, but I haven't been able to isolate it any further than that at this point.

When using Input Text with chrome and an exported X11 display, some input characters cause problems with the resulting element values. For example, the character r will cause the text to be truncated. The character e will cause the e and the character before it to go missing. The problem does not occur when using firefox.

I've included a screenshot using the test code in the issue reproduction section below. The first text box should contain the string abcdefg, and the second should contain opqrstu.

robot

I've tried numerous combinations of characters and string lengths. The results have always been consistent in regards to how each problematic character behaves. I have verified the issue is not just a rendering issue by using Get Element Attribute to read back the values.

Robot does not log any failures and thinks everything is fine.

Steps to reproduce the issue

I've removed as many variables as possible from this test. Instead of using a web server and application, I can produce the problem using just a simple html file named robot.html:

<html>
  <body>
    <input type="text" name="username" id="username">
    <input type="text" name="password" id="password">
  </body>
</html>

I've created the following robot file, named test.robot:

*** Settings ***
Library     SeleniumLibrary

*** variables ***
${URL}   file:///tmp/test.html
${Browser}   chrome 

*** Test Cases ***
Testing with Browser
    Open Browser  ${URL}  ${Browser}
    Set Window Size  ${640}  ${480}
    Sleep  3s
    Input Text  id:username  abcdefg
    Sleep  3s
    Input Text  id:password  opqrstu
    Sleep  5s
    Close Browser

I then just run robot test.robot.

Note, I am running robot on an AlmaLinux 8.8 VM with the display exported to the host. The behavior is the same when running headlesschrome and the display still set to the host's display. However, if I unset the DISPLAY variable, headlesschrome then works correctly.

The host is running macOS 12.7.1 and XQuartz 2.8.5.

Expected behavior and actual behavior

When I follow those steps, I see...

The first text box should contain the string abcdefg, and the second should contain opqrstu. However, as visible in the screenshot, the two text boxes instead contain abcfg and opq, respectively.

Environment

Browser: Google Chrome versions 114.0.5735.90, 120.0.6099.71, 120.0.6099.109
Browser driver: chromedriver versions 114.0.5735.90, 120.0.6099.71
Operating System: VM - AlmaLinux 8.8, Host - macOS 12.7.1 with XQuartz 2.8.5

Libraries (on VM)

  • Robot Framework: 6.1.1
  • Selenium: 4.16.0
  • SeleniumLibrary: 6.2.0
  • Python: 3.11.6
@emanlove
Copy link
Member

Curious as to whether or not using Press Keys keyword differs in behavior from Input Text.

@brandoncraig-gtri
Copy link
Author

Curious as to whether or not using Press Keys keyword differs in behavior from Input Text.

The behavior is exactly the same when using Press Keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants