Skip to content

[🐛 Bug]: getDomAttrtibute does not return the value after entering anything inside the textbox and print it #14896

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

Closed
shreyans1223 opened this issue Dec 13, 2024 · 5 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon!

Comments

@shreyans1223
Copy link

What happened?

Selenium Version: 4.27.0

Reproducible browsers: Chrome(V131), Edge(V131)

Steps to reproduce:

  1. Open any browser
  2. Add text into the textbox
  3. print the value using the getDomAttrtibute

Note: Issue does not reproducible for the getAttrtibute property.

How can we reproduce the issue?

public class getTextBoxValue() {
      public static void main(String[] args) {
           WebDriver driver = new ChromeDriver();
           driver.manage().window().maximize();
           driver.get("http://www.automationpractice.pl/index.php");

          WebElement element = driver.findElement(By.name("search_query"));
          element.click();
          element.sendKeys("iPhone");

          System.out.println(element.getDomAttrtibute("value"));
      }
}

Relevant log output

There is no value printed in console after running above script.

Operating System

Windows 11

Selenium version

Java(V21) & Selenium(4.27.0)

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

Chrome(V131), Edge(V131)

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

Chromedriver(V131)

Are you using Selenium Grid?

No response

@shreyans1223 shreyans1223 added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels Dec 13, 2024
Copy link

@shreyans1223, 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!

@gokulsam07
Copy link

@shreyans1223 getAttribute is deprecated, reason it didn't work is there is no corresponding value in the DOM for the attribute 'value'. Try with getDomProperty. It should work.

@joerg1985 joerg1985 added J-awaiting answer Question asked of user; a reply moves it to triage again and removed I-defect Something is not working as intended labels Jan 11, 2025
@github-actions github-actions bot removed the J-awaiting answer Question asked of user; a reply moves it to triage again label Jan 12, 2025
@shbenzer
Copy link
Contributor

@shreyans1223 did this solve your issue?

@shreyans1223
Copy link
Author

Yes, Issue has been resolved. Thanks!

Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-needs-triaging A Selenium member will evaluate this soon!
Projects
None yet
Development

No branches or pull requests

4 participants