Hi Chuck,

I was able to retrieve the headers with your suggestion.  I didn't need to
deal with CSS so this perfectly.  Thank you.


Code:

#Retrieve Header tags
        hdr1 = @browser.div(:class,'discussion-board-toolbar').h1.text

        hdr2 = @browser.div(:class,'discussion-board-toolbar').h2.text

        page_header = "#{hdr1}#{hdr2}"

Thank you,
Joe

On Tue, Oct 25, 2011 at 12:46 PM, Chuck van der Linden <[email protected]>wrote:

> On Oct 25, 7:26 am, Joe Fl <[email protected]> wrote:
> > Yes, link should be topic.  I get the same results with /n (new line)
> > though I need assistance with verifying that header displays.
> >
> > When I highlight the line on the webpage there is a break between the
> > MEMBER DISCUSSIONS: and AMBULATORY/OUTPATIENT CARE headers.
> >
> > I am not able to verify the entire header.  Not sure why. I thought it
> > might be because it is two separate headers with the &nbsp at the end
> > of the first header <H1>
> >
> > The reason I use upcase is because on the page itself it displays in
> > Upper Case.
> >
> >
>
> Are you sure it's upper case and not just the font being used for
> headers?
>
> I might suggest trying the following in IRB
>
> puts browser.div(:class, "discussion-board-toolbar").text
> puts browser.div(:class, "discussion-board-toolbar").h1.text
> puts browser.div(:class, "discussion-board-toolbar").h2.text
>
> Go with whatever you see there as what you'd be trying to match.
>
> also instead of looking for the text on the entire page, if you know
> it's supposed to be inside that toolbar div, then why not just look
> for it that way?
>
> browser.div(:class, "discussion-board-toolbar").h2.text.contains?
> 'Ambulatory/Outpatient Care'
>
>  Potentially the page could be using some CSS magic to do a case
> transform on text that is inside a div of that class, so the actual
> HTML could be mixed case, but it is rendered visually (via cascading
> style sheet functions) as upper case, or using an 'all uppers' style
> font.   Watir and Watir-Webdriver look at what is in the DOM, so
> generally see the text before any CSS transforms have altered it in
> any way for rendering.
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to