[Wtr-general] Can I access caption attribute of a checkbox?

Amitha Shetty amithashettyb at yahoo.co.in
Wed Jun 21 06:55:52 EDT 2006


Hi,
   I installed watir 1[1].5.1.gem. 
  When I say  ie.frame(:index,1).checkboxes[1].attribute_value("caption")
   it prints nill. 
  But when I say ie.frame(:index,1).checkboxes[1].attribute_value("name") 
  it prints 'ID_1'.
  Still I am not able to retrieve the actual display name of the checkbox i.e 'Male'.


Zeljko Filipin <zeljko.filipin at gmail.com> wrote:
  That is the latest official version, but I think Angrez was reffering to development build. You can get it here:
http://wiki.openqa.org/display/WTR/Development+Builds 

  On 6/19/06, Amitha Shetty <amithashettyb at yahoo.co.in> wrote:      

   I am using latest watir version i.e 1.4.1.



_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-generalHi,

Which watir version are you using? Latest version has a method called 'attribute_value' that you can try that to get the value of 'caption' attribute. So you try the following:

ie.checkboxes[1].attribute_value("caption") 

Regards,
Angrez


  Hi,
    I see a screen with checkboxes(in a tree strucuture) and labels beside the checkboxes. Developers are using third party libraries(javascripts) to generate these checkboxes and they are placing a label beside the checkbox. 
   
  When I do a view source on this page I see the following code which has the actual label(Male).
   
  var a = new Array; 
a[0] = new Array; 
a[0]['id'] = '1'
  a[0]['checkboxName'] =''ID_1''
a[0]['caption'] = 'Male'(#This is the data I want to retrieve)
  a[0]['isOpen'] = true
a[0]['children'] = new Array;
a[0]['children'][0] = new Array;
a[0]['children'][0]['id']='2'; 
a[0]['children'][0]['caption']=''Female';
a[0]['children'][0]['checkboxName']='ID_2';

  but when I say   ie.checkboxes[1].name , it returns the text ID_1.
  But I am interested in the caption of the checkbox i.e Male
   
  How do I retrieve this caption?
   
  Third party libraries used for generating the checkboxes as found in View Source:
  <script type="text/javascript" src="./js/Bs_Misc.lib.js"></script>
<script type="text/javascript" src="./js/Bs_Array.class.js"></script>
<script type="text/javascript" src="./js/Bs_Tree.class.js"></script>
<script type="text/javascript" src="./js/Bs_TreeElement.class.js"></script>
<script type="text/javascript" src="./js/Bs_Checkbox.class.js"></script>
  

' 


   
   
  Thanks,

            Amitha





  


 				
---------------------------------
  Yahoo! India Answers: Share what you know. Learn something new Click here
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060621/f9f83fb5/attachment.html 


More information about the Wtr-general mailing list