Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
Using Selenium Web Driver to retrieve value of a HTML input
Home
Education
Using Selenium Web Driver to retrieve value of a...
asked
Feb 8, 2022
in
Education
by
JackTerrance
In the HTML of a web app, there is the following code
What is actually shown on the page is a string displaying the time. In Selenium Web Driver, I have a WebElement object referring to the
using WebElement timeStamp = waitForElement(By.id("prettyTime")); I want to get the value of the WebElement, or, in other words, what is printed on the page. I tried all the WebElement getters and nothing has been retrieving the actual value that the user sees. Any help? Thanks. Select the correct answer from above options
java
selenium
selenium-webdriver
1
Answer
0
votes
answered
Feb 8, 2022
by
JackTerrance
Best answer
The following code is what I use in Selenium 2.0: WebElement element = driver.findElement(By.id("input_name")); String elementval = element.getAttribute("value"); OR String elementval = driver.findElement(By.id("input_name")).getAttribute("value"); Hope this was helpful.
Related questions
0
votes
Q: How can I ask the Selenium-WebDriver to wait for few seconds in Java?
I'm working on a Java Selenium-WebDriver. I added driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); ... a better way? Select the correct answer from above options...
asked
Feb 8, 2022
in
Education
by
JackTerrance
java
selenium
selenium-webdriver
webdriver
0
votes
Q: How to select/get drop down option in Selenium 2
I am converting my selenium 1 code to selenium 2 and can't find any easy way to select a label in a ... ("//path_to_drop_down"); Select the correct answer from above options...
asked
Feb 8, 2022
in
Education
by
JackTerrance
java
selenium
drop-down-menu
selenium-webdriver
0
votes
Q: selenium open new tab-How to open a new tab using Selenium WebDriver?
How to open a new tab in the existing Firefox browser using Selenium WebDriver (a.k.a. Selenium 2)? Select the correct answer from above options...
asked
Feb 8, 2022
in
Education
by
JackTerrance
selenium
firefox
selenium-webdriver
browser-tab
0
votes
Q: sendkeys are not working in Selenium Webdriver
I want to put value using webdriver, This is the command I am using driver.findElement(By.name("name")).sendKeys(" ... way to do so ? Select the correct answer from above options...
asked
Jan 22, 2022
in
Education
by
JackTerrance
selenium
selenium-webdriver
0
votes
Q: Is Selenium a good career option?
Could someone tell me whether Selenium is a good career option? Select the correct answer from above options...
asked
Jan 6, 2022
in
Education
by
JackTerrance
selenium
selenium-ide
selenium-webdriver
0
votes
Q: Debugging “Element is not clickable at point” error
I see this only in Chrome. The full error message reads: "org.openqa.selenium.WebDriverException: Element is not ... for scrolling. Select the correct answer from above options...
asked
Jan 25, 2022
in
Education
by
JackTerrance
google-chrome
selenium
selenium-webdriver
automated-tests
0
votes
Q: Page scroll up or down in Selenium WebDriver (Selenium 2) using java
I use Selenium RC, for which the scroll command is selenium.getEval("scrollBy(0, 250)"); Now, I have started ... the command for it? Select the correct answer from above options...
asked
Jan 23, 2022
in
Education
by
JackTerrance
java
scroll
selenium-webdriver
selenium-rc
0
votes
Q: How to get HTTP Response Code using Selenium WebDriver
I have written tests with Selenium2/WebDriver and want to test if HTTP Request returns an HTTP 403 Forbidden. ... Selenium WebDriver? Select the correct answer from above options...
asked
Feb 8, 2022
in
Education
by
JackTerrance
java
selenium
webdriver
httprequest
httpresponse
0
votes
Q: Casperjs/PhantomJs vs Selenium
We are using Selenium to automate our testing. Recently we have seen the majority of our users using Chrome. ... over Selenium? Select the correct answer from above options...
asked
Feb 8, 2022
in
Education
by
JackTerrance
google-chrome
user-interface
selenium
automation
phantomjs
0
votes
Q: Select parent element of known element in Selenium
I have a certain element that I can select with Selenium 1. Unfortunately, I need to click the parent element ... upwards with XPath? Select the correct answer from above options...
asked
Feb 8, 2022
in
Education
by
JackTerrance
select
xpath
selenium
parent
0
votes
Q: Why do we need to run Selenium tests in parallel?
I am new in software testing and looking to enhance my knowledge. I want to know in detail about: What is ... answer here. Thanks! Select the correct answer from above options...
asked
Jan 19, 2022
in
Education
by
JackTerrance
selenium
parallel-testing
automated-tests
0
votes
Q: How can we take input text from user in HTML page?
How can we take input text from user in HTML page? (a) input tag (b) inoutBufferedReader tag (c) meta ... & Servlet of Java Select the correct answer from above options...
asked
Feb 22, 2022
in
Education
by
JackTerrance
java
serve
0
votes
Q: Show value from input in exporting html code to pdf using jspdf
If my post duplicated, please give me references. because i failed finding post that appropriate from my ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
Jun 14, 2022
in
Education
by
JackTerrance
jqueryhtml
0
votes
Q: Explain Which of these methods is used to retrieve the elements in properties object at specific location?
Which of these methods is used to retrieve the elements in properties object at specific location? (a) get() ... Framework of Java Select the correct answer from above options...
asked
Mar 1, 2022
in
Education
by
JackTerrance
java
util
0
votes
Q: How could we retrieve a single value from data base using Groovy?
How could we retrieve a single value from data base using Groovy?...
asked
Sep 25, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
...