You should take a look at http://wiki.openqa.org/display/WTR/XPath.

Something like this should work:

puts browser.link(:xpath,"//a...@href='/job/peoplesoft-b-test-b-b-
analyst-b/brisbane/15956235/']/").text

Hope it helps.

On Sep 10, 8:32 am, Guy <guy.kid...@gmail.com> wrote:
> Hi Orde,
>
> It is very helpful and I already put that in my script.
> I would appreciate help with the next (xpath)
>
> I try to get the "PEOPLESOFT TEST ANALYST" and the date 'Fri 04 Sep'
> using xpath without getting the right value. Any ideas would be
> welcome.
>
> <div id=resultsList class=><ol id="searchResultsList"><li><span
> class="jobsearchNumber">1<input type="checkbox" name="chkJob"
> onClick="UpdateSelectedItems();" value="15956235"></input></
> span><div><h2><a href="/job/peoplesoft-b-test-b-b-analyst-b/brisbane/
> 15956235/">PEOPLESOFT <span class="highlight">TEST ANALYST</span></a>
>                             <em>Integrated Business Technologies Pty
> Ltd</em></h2><span class="jobSearchJobListedDate">Fri 04 Sep</
> span><div><p>Immediate requirement for an experienced PeopleSoft test
> analyst across HR/Payroll</p><span class="taxonomy"><a
> href="javascript:ClassTree('catindustry=1215')">I.T. &amp; T</a> &gt;
> <a href="javascript:ClassTree
> ('catoccupation=1491&amp;catindustry=1215')">QA/Testers</a></span></
> div><h3>Brisbane</h3><h3></h3></div></li><li><span
>
> Many Thanks,
>
> Guy
>
> On Sep 10, 2:21 am, orde <ohil...@gmail.com> wrote:
>
> > This will give you the number of links:
>
> > browser = [your browser of choice]
>
> > puts browser.links.length
>
> > -------
>
> > To create the loop:
>
> > while browser.image(:src, /bullet_search_white_small.gif/).exists?
> >   puts 'exists'
> >   sleep 2
> >   browser.refresh
> > end
>
> > Hope that helps.
>
> > orde
>
> > On Sep 9, 7:56 am, Guy <guy.kid...@gmail.com> wrote:
>
> > > Hello All,
>
> > > I'm New with watir but appreciate how good it is.
> > > I'm looking for a way to count all PageTo(*) elements or to loop until
> > > the bullet_search_white_small.gif ('Next' image) doesn't exist in the
> > > page
> > > Follows is the html code from the site
> > > <div class='searchPagination'><dl class='jobSearchPagination'>
> > > <a class='nextPage btn pinkbtn_small' href="javascript: PageTo
> > > (4)"><strong>Next<img src='/general_ID_items/images/other/
> > > bullet_search_white_small.gif'></strong></a><dt>Page</dt>
> > > <dd><a href="javascript: PageTo(1)">1</a></dd>
> > > <dd><a href="javascript: PageTo(2)">2</a></dd><dd
> > > class='currentPage'><span>3</span></dd>
> > > <dd><a href="javascript: PageTo(4)">4</a></dd>
> > > <dd><a href="javascript: PageTo(5)">5</a></dd>
> > > <dd><a href="javascript: PageTo(6)">6</a></dd>
> > > <dd><a href="javascript: PageTo(7)">7</a></dd>
> > > <dd><a href="javascript: PageTo(8)">8</a></dd>
> > > <dd><a href="javascript: PageTo(9)">9</a></dd>
> > > <dd><a href="javascript: PageTo(10)">10</a></dd></dl></div>
> > >         </div>
> > > Cheers,
> > > Guy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to