Interesting... I'm assuming table matching is the ticket and dynamic
variables being the pain...
Try this snippet and modify to suit for page

require 'watir'
require 'watir/ie'
require 'watir/dialog'
require 'Win32API'

  ie = Watir::IE.new
  sURL='http://www.google.com'
  sURL='C:\Documents and Settings\kpetry\Desktop\t.html'
  ie.goto(sURL)
  ie.bring_to_front()
  myTable=ie.table(:index,1)
  # loop through the table by indexing the first variable if needed
until a match
  pollText=myTable[1][1].text.upcase
  #Obvious Text matching here.... Then invoke this code stream
  theParse=myTable[1][3].attribute_value("InnerHTML")
  puts theParse
  iStart = theParse.rindex('id=')+3
  iEnd = theParse.rindex('type=radio')-1
  theId= theParse.slice!(iStart..iEnd).strip!
  puts iStart.to_s
  puts iEnd.to_s
  puts theId+'..'
  ie.radio(:id, theId ).flash
  ie.radio(:id, theId ).set


On Oct 22, 8:31 am, Amit Kulkarni <amitkkulkarni...@gmail.com> wrote:
> Thanks a lot.But the name "act2[165]" is not going to be same all the time.
> I have my poll title as Test.So i want to set my focus on delete radio
> button whose title is Test.
> Is it possible to do this?
>
> This is my html script
> <tr>
> <td>Test</td>
> <td>Unpublished</td>
> <td class="actions">
> <label for="Update">
> <input id="act2_165_update" type="radio" value="update" name="act2
> [165]"/>
> Update
> </label>
> <label for="del2">
> input id="act2_165_delete" type="radio" value="delete" name="act2
> [165]"/>
> Delete
> </label>
> </td>
>
> Now here <td>Test</td> is the title of the poll.
> So i want to click on delete radio button which has a title named Test :-)
> On Thu, Oct 22, 2009 at 6:51 PM, Super Kevy
> <kpe...@scholarshipamerica.org>wrote:
>
>
>
>
>
> > Try something like this where value="delete" or "update"
> >   ie.radio(:name,'act2[165]',value).focus
> >   ie.radio(:name,'act2[165]'',value).set- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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