I've included a sample of both the left panel (outline) and the right
panel (content) below.
If I click on "DEFINITIONS" in the outline, I expect to see
"Definitions" as the first line in right panel.
The line of code I wrote for doing this verification...
        topicContentFirstLine = @browser.div(:id,
'topicText').text.first
but it returns the first line of the content (Introduction), not the
first line of the displayed content.
I also tried
        topicContentFirstLine = @browser.div(:id,
'topicText').text.visible?
but got errors about undefined method for visible

I'm using Ruby 1.8.7
and Watir 1.9.0

This is a sample of the HTML for the left panel (the outline)
---------------------------------------------------------------------------------------------------------------------------------------------------
<div id="outline">
<ul>
<li class="plainItem">
<a class="outlineLink" href="#H1">INTRODUCTION</a>
</li>
<li class="plainItem">
<a class="outlineLink" href="#H2">DEFINITIONS</a>
</li>
<li class="plainItem">
<a class="outlineLink" href="#H3">ETIOLOGY</a>
</li>
---------------------------------------------------------------------------------------------------------------------------------------------------------

This is a sample of the HTML for the right panel (the content)
----------------------------------------------------------------------------------------------------------------------------------------------------
<div id="rightPanel">
<noscript> &lt;div id="javascriptDisabled"&gt; It seems to us that you
have your JavaScript turned off on your browser. JavaScript is
required in order for our site to behave correctly. Please enable your
JavaScript to continue use our site. &lt;/div&gt; </noscript>
<div id="printHeader">
<div id="topicContent">
<div id="topicTitle">Approach to the child with fever topic</div>
<div id="topicContributors">
<p class="disclosureLink">
<div id="topicVersion">
<div id="topicText">
<p id="H1" class="headingAnchor">
<span class="h1">INTRODUCTION</span>
&nbsp;&mdash;&nbsp;Fever is a common presenting complaint in children[
<a class="citation" href="/contents/approach-to-the-child-with-fever/
abstract/1">1</a>
]. first introduction sentence. [
<a class="citation" href="/contents/approach-to-the-child-with-fever/
abstract/2">2</a>
]. second introduction sentence.
</p>
<p>
new paragraph
</p>
<p id="H2" class="headingAnchor">
<span class="h1">DEFINITIONS</span>
&nbsp;&mdash;&nbsp;The term FUO initially was reserved for adults with
fever &gt;38.4ºC (101.2ºF) on at least several measurements over three
or more weeks without an established cause after at least one week of
investigation in the hospital.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

On Jul 15, 9:43 am, Željko Filipin <[email protected]>
wrote:
> On Thu, Jul 14, 2011 at 6:59 PM, Anne <[email protected]> wrote:
> > But I can't figure out how to
> > restrict my verification to just what is currently visible.
>
> Please provide relevant HTML.
>
> Željko
> --
> watir.com - community manager
> watir.com/book - author
> watirpodcast.com - host

-- 
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