SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.53k stars 8.16k forks source link

[πŸ› Bug]: cleared text reappears when new text is entered #14610

Open picarro-pkumar opened 1 day ago

picarro-pkumar commented 1 day ago

What happened?

Browser: Version 130.0.6723.59 (Official Build) (arm64)

Selenium Version: org.seleniumhq.selenium:selenium-devtools-v86:4.8.2

Details: I wrote code to clear the entered text and then input new text, but every time, the cleared text would reappear along with the new text, resulting in both being concatenated

Here is code:

public void sendKeysToWebelement(By by, String string) {
        Wrapperdriver.findElement(by).clear();

        Wrapperdriver.findElement(by).sendKeys(string);
    }

Sharing DOM structure of user field <input aria-invalid="false" id=":r1v:" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" type="username" value="">

Note: This website has another username field on a different Page where the above-shared code works perfectly. Sharing DOM structure of this Username: <input autocomplete="off" type="password" class="MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart css-mnn31" name="password">

How can we reproduce the issue?

public void sendKeysToWebelement(By by, String string) {
        Wrapperdriver.findElement(by).clear();

        Wrapperdriver.findElement(by).sendKeys(string);
    }

### Relevant log output

```shell
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
<log>
<record>
  <date>2024-10-17T09:36:29.799187Z</date>
  <millis>1729157789799</millis>
  <nanos>187000</nanos>
  <sequence>2</sequence>
  <logger>com.abc.Tests.SAT.SAT_SidebarMenusTestCases</logger>
  <level>WARNING</level>
  <class>com.abc.Tests.SAT.SAT_SidebarMenusTestCases</class>
  <method>HAR_TC_2046_Test</method>
  <thread>1</thread>
  <message>this is a warning</message>
</record>
<record>
  <date>2024-10-17T09:36:29.801918Z</date>
  <millis>1729157789801</millis>
  <nanos>918000</nanos>
  <sequence>3</sequence>
  <logger>com.abc.Tests.SAT.SAT_SidebarMenusTestCases</logger>
  <level>INFO</level>
  <class>com.abc.Tests.SAT.SAT_SidebarMenusTestCases</class>
  <method>HAR_TC_2046_Test</method>
  <thread>1</thread>
  <message>this is useful information</message>
</record>
<record>
  <date>2024-10-17T09:36:29.802698Z</date>
  <millis>1729157789802</millis>
  <nanos>698000</nanos>
  <sequence>4</sequence>
  <logger>com.Abc.Tests.SAT.SAT_SidebarMenusTestCases</logger>
  <level>FINE</level>
  <class>com.abc.Tests.SAT.SAT_SidebarMenusTestCases</class>
  <method>HAR_TC_2046_Test</method>
  <thread>1</thread>
  <message>this is detailed debug information</message>
</record>

Operating System

MacOS sonoma

Selenium version

4.8.2

What are the browser(s) and version(s) where you see this issue?

chrome 130.0.6723.59

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 130.0.6723.58

Are you using Selenium Grid?

No response

github-actions[bot] commented 1 day ago

@picarro-pkumar, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!