Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» why do i get this error
Yesterday at 9:43 pm by anbarasi

» wait property
Yesterday at 12:50 pm by anbarasi

» What is the use of Selenium Remote Control
Fri Apr 21, 2017 7:24 pm by azharuddin

» How can I fix it? TCP PORT Exhaustion
Wed Apr 19, 2017 3:29 pm by JohnSnow

» Difference between QTP, Selenium and Silk test
Wed Apr 19, 2017 2:30 pm by Basilios Will

» Locator for google document
Tue Apr 18, 2017 10:01 pm by SergeyK

» I encountered a mistake: Couldn't register this node
Sat Apr 15, 2017 9:06 pm by skyshine725

» Current version tutorial for just creating a browser instance - Visual Studio
Fri Apr 14, 2017 2:47 am by KilpAr

» cant able to select drop down otions
Thu Apr 13, 2017 6:08 pm by anbarasi

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to get the value of an input with Web Driver?

View previous topic View next topic Go down

How to get the value of an input with Web Driver?

Post by guerrila on Wed Jul 06, 2011 11:15 pm

Hello,

I'm new to Selenium 2 and I've read through the intro stuff and the tutorials, and I have my Selenium tests up and running nicely so far. However, I do have one basic question that I think I may have missed in the documentaiton, or perhaps it's harder to find than I thought...I need to verify the actual text value of an input rendered on screen ... I'm able to get the correct WebElement with an ID:

WebElement passwordInput2 = driver.findElement(By.name("password"));

however passwordInput2.getText() returns just an empty string (actually all webElements.getText() returns an empty string). Is there a better way to get to the text value of an input? I see lots of stuff on how to do this with Selenium IDE ... is Selenium IDE simply more powerful than the Selenium 2/WebDriver approach with Java?

Thanks so much in advance,
Pedro

guerrila

Posts : 1
Join date : 2011-07-06

Back to top Go down

Re: How to get the value of an input with Web Driver?

Post by ashish_techie on Fri Nov 04, 2011 9:28 pm

try getAttribute("value")

-Ashish
For selenium training and videos over 55 hours duration visit
http://qtpselenium.com/samplevideos/selenium/seleniumvideos.php

ashish_techie
Amateur
Amateur

Posts : 73
Join date : 2011-08-09

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum