1

I am using Selenium library for testing.

I have this little code:

Dim driver As New FirefoxDriver()
driver.Navigate().GoToUrl("C:\Users\Amodio\Desktop\HTMLPage1.htm")
driver.FindElement(By.Id("30")).SendKeys("1234")
MsgBox(driver.FindElement(By.Id("30")).Text)

The problem is that, in the messagebox i cannot see the value of the control.

It can send keys correctly, but in the next line code cannot catch the value.

1
  • What kind of element is it? An input? Commented Jun 12, 2013 at 16:03

1 Answer 1

1

Like what you said in your question title, you want to show textbox's value.

For textboxes, element.GetAttribute("value") is the one you want, rather than element.Text.

MsgBox(driver.FindElement(By.Id("30")).GetAttribute("value"))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.