[wtr-general] Re: Safari Getting Table Cell Text
Sorry I put down the wrong error message. I'm actually getting /Library/Ruby/Gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/ scripter.rb:189:in `find_cell': uninitialized constant Watir::JavaScripter::MissingWayOfFindingObjectException (NameError) My code: require 'rubygems' require 'safariwatir' @b = Watir::Safari.new @b.goto(my_webpage) cell = @b.table(:class, user-table)[0][1] #getting row 0 cell 1 puts cell.text I followed all the instructions on this page https://github.com/zeljkofilipin/watirbook/blob/master/installation/mac.md All of my gems are up to date. Thanks for your help On Dec 8, 4:49 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Dec 7, 2011 at 5:32 PM, Brad bradask...@gmail.com wrote: It seems like this should be working cell = @b.table(:class, user-table)[0][1] #getting row 0 cell 1 puts cell.text O have replied at SO: http://stackoverflow.com/questions/8419360/getting-cell-text-from-a-t... Željko -- watir.com/book - author -- 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
[wtr-general] Re: Safari Getting Table Cell Text
What method does it say is missing? and which line of the code is generating the error? (just to be clear and not make assumptions) If you are using Safariwatir to do safari, it's fairly old.. I have not used it, but did it use the older Watir convention of one based indexing? You might try a little work with IRB and the .flash method to be sure it's pointing to the right cell in the table (e.g. try 0,1 and if that does not work try 1,2 Normally I'd just do it as one one line of code instead of two, not sure if that would make a difference however.. puts @b.table(:class, user-table)[0][1].text On Dec 7, 8:32 am, Brad bradask...@gmail.com wrote: I've been pulling my hair out trying to figure out why Safari isn't getting cell text from a table. It seems like this should be working cell = @b.table(:class, user-table)[0][1] #getting row 0 cell 1 puts cell.text I get a missing method error. Chrome works just find. What's the deal? -- 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