If I read you correctly, the challenge is "get the contents of the
second cell on the table row where the first cell is 'change counter'"
is that right?

Presuming that "change counter" appears nowhere else in that table,
AND that you have some way to identify the table itself, or a
container that holds the table

browser.table(:how, "what").row(:text, /counter change/).cell(:index,
2).text

if there is no other row in any other table that contains 'counter
change' then you might even be able to do it by going straight to the
row and not worrying about the table element.

browser.row(:text, /counter change/).cell(:index, 2).text

To understand why that works, do some googling and reading about
something called 'regular expressions'

PS  for challenges like this, a tiny bit more of the HTML such as
details on the table, can be useful in terms of people being able to
give you better examples of the code you would need to use.   The more
details you put into a question on the group, the more likely you are
to get a more 'exact' answer instead of a generic one.


On Mar 3, 10:57 am, Ashu <[email protected]> wrote:
> ya I agree with Orde
>
> well my testing page contains multiple "<tr>" with same class = normal
> and div contains class = system for every "<tr>"
>
> On Mar 3, 10:27 am, orde <[email protected]> wrote:
>
> > Find a way to determine the value of <div class="system"> and assign
> > it to a variable.
>
> > On Mar 3, 1:35 am, Ashu <[email protected]> wrote:
>
> > > The xpath for the html
> > > html  <tr><td class="normal">counter change</td><td
> > > class="normal"><div class="system">1</div></td></tr>
>
> > > is xpath  /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/
> > > td[2]/div
>
> > > On Mar 3, 2:17 pm, Ashu <[email protected]> wrote:
>
> > > > hi,
> > > > there is a field on the php page that keeps track of the change in
> > > > counter field.
> > > > On every next refresh the value changes of that variable.
> > > > <tr><td class="normal">Change counter</td>
> > > > <td class="normal"><div class="system">1</div></td></tr>
> > > > The "1" in the above code determines that one transaction has taken
> > > > place and it continues to increase up on every transaction update.
> > > > I am unable to figure out the logic to keep track of the change.

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