Yes i found a soluiton with Xpath: $ie.table(:xpath,"//div/h4/div[contains(text(),'ti podaci')]/ parent::*/following-sibling::*/child::table")[1][2].text
and i get correct data fom table. br,Dani On 15 nov., 16:37, Danijel <danijel.vuko...@gmail.com> wrote: > Hy, > > I have to problem find a parent element and search its next sibling. > My HTML looks like: > .. > <DIV> > <H4><DIV>TEST</DIV> </H4> > <DIV> > <Table> > <Tbody> > <TR><TD>1. Name</TD><TD>Dani</TD></TR> > </Tbody> > </Table> > </DIV> > </DIV> > ... > > this is insert of HTML code from wghich i would like to get values of > table. First DIV can be displayed as index "4,5,6". > > Exists better way to find table element. PRoblem is that i do not have > Id, names, classes for same elements are same. > > i use: > puts $ie.h4(:xpath,"//h4/ > div[contains(text(),'TEST')]").parent.table("//div/table/tbody/tr[1]/ > td[1]").text > > or > > puts $ie.h4(:xpath,"//h4/div[contains(text(),'TEST')]").parent.table("/ > div/table/tbody/tr[1]/td[1]").text > > and i get error message: > 1) Error: > test_aaa(SMOKE_TEST): > Watir::Exception::UnknownObjectException: Unable to locate element, > using "//div/table/tbody/tr[1]/td[1]" > D:/avtomatizacija/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ > element.rb:58:in `assert_exists' > D:/avtomatizacija/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ > element.rb:124:in `text' > ./sup.rb:694:in `fn_preberi_dodBDok' > jpr_smoke.rb:3542:in `test_aaa' -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com