How to getText() from an element using Java?
See original GitHub issueWhen I call getText() upon an element I’m getting the following message:
NO GET TEXT (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 16 milliseconds Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700' System info: host: 'd-1816', ip: '10.10.25.26', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0' Driver info: org.openqa.selenium.winium.WiniumDriver Capabilities [{app=C:\Windows\system32\calc.exe, args=, innerPort=9998, debugConnectToRunningApp=false, keyboardSimulator=1, launchDelay=0, platform=ANY}] Session ID: AwesomeSession
Is there a way of getting an elements text with Winium?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to Get Text of an Element in Selenium: Tutorial
getText() method returns string as a result. It removes the whitespaces if present in the front and back of the string. Note: Using...
Read more >How To Get Text Of An Element In Selenium?
The getText() method in Selenium WebDriver is a powerful tool for retrieving the visible text of a specific web element. By calling this...
Read more >Selenium getText - java
getText() returns the visible text of this element. java.lang.String getText() Get the visible (i.e. not hidden by CSS) text of this element, ...
Read more >How to get text from Selenium element WebElement object
We can get text from a webelement with Selenium webdriver. The getText() methods obtains the innerText of an element. It fetches the text...
Read more >getText() method in Selenium Java with Examples
getText() method is used to get the visible text of an element in Selenium. This post will discuss the getText() method of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
getText
should work independently of bindings language you chose to use.In case of windows calc.exe you should use
Name
property on the result element, notgetText
.Here is sample in python
Please make sure that the element itself has a text value. If some child of found element has the text, no the element you located, then try get this child element first and call
getText
on the child.Internally Winium tries to use TextPattern first, then ValuePattern to get text of the element. If the element does not support those automation patterns (i.e. it is some custom element that does not implement patterns), then the method will fail.
Applicable to java as well. I used it for to get a label displayed on a Button. driver.findElement(By.id(“id”)).getAttribute(“name”);