Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 923301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:10:14+00:00 2026-05-15T19:10:14+00:00

I am using Watir to write some tests for a web application. I need

  • 0

I am using Watir to write some tests for a web application. I need to get the text ‘Bishop’ from the HTML below but can’t figure out how to do it.

<div id="dnn_ctr353_Main_ctl00_ctl00_ctl00_ctl07_Field_048b9dfa-bc64-42e4-8bd5-b45385e5f45b_view" style="display: block;">
   <div class="workprolabel wpFieldLabel">
    <span title="Please select a courtesy title from the list.">Title</span>&nbsp;<span class="validationIndicator wpValidationText"></span>
   </div>
   <span class="wpFieldViewContent" id="dnn_ctr353_Main_ctl00_ctl00_ctl00_ctl07_Field_048b9dfa-bc64-42e4-8bd5-b45385e5f45b_view_value"><p class="wpFieldValue ">Bishop</p></span>
  </div>

Firebug tells me the xpath is:

html/body/form/div[5]/div[6]/div[2]/div[2]/div/div/span/span/div[2]/div[4]/div[1]/span[1]/div[2]/span/p/text()

but I cant format the element_by_xpath to pick it up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:10:14+00:00Added an answer on May 15, 2026 at 7:10 pm

    You should be able to access the paragraph right away if it’s unique:

    my_p = browser.p(:class, "wpFieldValue ")
    my_text = my_p.text
    

    See HTML Elements Supported by Watir

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started using Watir to write some simple tests for my web application.
I've written an rspec test using Watir against a web application and it's running
I'm using Watir 1.6.7. I'm working on developing some regression tests for a PeopleSoft
In Watir you can get WIN32OLE handle of IE window using next method. irb(main):059:0>
I'm using Firefox 13 and Watir-webdriver on windows via Ruby 1.9.2 and porting some
I am using rspec and cucumber to run watir tests at sauce labs. I
I'm using Watin to automate download file from a website. At some point a
I'm using WatiN for web application testing. There is a field called enter choices
I am using watir-webdriver and am attempting to check the background-color of an HTML
I'm using Watir to do some automated testing for a website. This particular test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.