Re: [Wtr-general] Can I access caption attribute of a checkbox?
Hi, I am using latest watir version i.e 1.4.1. When I say ie.frame(:index,3).checkboxes[1].attribute_value("caption") , it throws exception saying "undefined method `attribute_value' for #Watir::CheckBox:0x2e27498 (NoMethodError)"How do I proceed?Thanks, AmithaAngrez Singh [EMAIL PROTECTED] wrote: Hi,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 On 6/15/06, Amitha Shetty [EMAIL PROTECTED] wrote: Hi, Sorry thats the javascipt which I had given. Checkboxes on this page are generated by a third party tool which uses the following _javascript_s: script type="text/_javascript_" src=""/script script type="text/_javascript_" src=""/scriptscript type="text/_javascript_" src=""/scriptscript type="text/_javascript_" src=""/script script type="text/_javascript_" src=""/scriptIs there way to access the html generated this way?I want to get the display name of the checkbox which is present as caption in the view source pageas "a[0]['children'][0]['children'][0]['children'][0]['caption']='CHILD_A2;"I want the text "CHILD_A2"View Sourceof the page looks like this: !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" htmlheadtitleCHECK/title script type="text/_javascript_" src=""/script script type="text/_javascript_" src=""/scriptscript type="text/_javascript_" src=""/scriptscript type="text/_javascript_" src=""/script script type="text/_javascript_" src=""/script script type="text/_javascript_" function init() { myTree = new Bs_Tree(); myTree.imageDir = './images/'; myTree.useCheckboxSystem = true; myTree.useAutoSequence = false; myTree.checkboxSystemWalkTree = 3; myTree.initByArray(a); myTree.drawInto('treeDiv1');} /scriptscripttype = "text/_javascript_" var a = new Array; a[0] = new Array; a[0]['id'] = '9' a[0]['checkboxName'] ='CNAME_14'a[0]['caption'] = 'Check Here' (#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']='51'; a[0]['children'][0]['caption']='CHILD_A';a[0]['children'][0]['checkboxName']='VELOZ_51';a[0]['children'][0]['children'] = new Array; a[0]['children'][0]['children'][0] = new Array;a[0]['children'][0]['children'][0]['id']='52'; a[0]['children'][0]['children'][0]['caption']='CHILD_A1;a[0]['children'][0]['children'][0]['checkboxName']='ID_52'; a[0]['children'][0]['children'][0]['children'] = new Array;a[0]['children'][0]['children'][0]['children'][0] = new Array;a[0]['children'][0]['children'][0]['children'][0]['id']='54'; a[0]['children'][0]['children'][0]['children'][0]['caption']='CHILD_A2; a[0]['children'][0]['children'][0]['children'][0]['checkboxName']='ID_54'; /script body div style="margin-top:5px;margin-left:5px;" id="treeDiv1"/div/body /html Thanks, Amitha Zeljko Filipin [EMAIL PROTECTED] wrote: You have input type="checkbox" caption="Check Here" /? It is not valid html. Check it for yourself at http://validator.w3.org/. ___Wtr-general mailing list Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-generalHi, Can I access caption attribute of a checkbox? I want to retrieve the display name of the checkbox and this data is present in the caption attribute in the html source. The checkboxes are in the form of a tree. HTML Source is: var a = new Array; a[0] = new Array; a[0]['id'] = '9'a[0]['checkboxName'] ='CNAME_14'a[0]['caption'] = 'Check Here' (#This is the data I want to retrieve) ie.checkboxes[1].name gives CNAME_14 but ie.checkboxes[1].caption throws the following exception: undefined method `caption' for #Watir::CheckBox:0x33c6b38 (NoMethodError)I want to get the data in caption attribute i.e 'Check Here'. How do I retrieve it? Thanks, Amitha Send instant messages to your online friends http://in.messenger.yahoo.com Stay connected with your friends even when away from PC. Link: http://in.mobile.yahoo.com/new/messenger/ ___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general___Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general Yahoo! India Answers: Share what you know. Learn something new Click here Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Can I access caption attribute of a checkbox?
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 [EMAIL PROTECTED] wrote: I am using latest watir version i.e 1.4.1. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] CVS download
Those pages do appear to be autogenerated, as they're not in the website directory.I'll send a message to Patrick to double check and if so, ask that he make the change. -Charley On 6/17/06, Bret Pettichord [EMAIL PROTECTED] wrote: On 6/17/06, Zeljko Filipin [EMAIL PROTECTED] wrote: at http://openqa.org/watir/cvs.action it is stated that watir can be checked out from http://svn.openqa.org/svn/watir/trunk . You should change it to http://svn.openqa.org/svn/watir/trunk/watir. I think that page is auto-generated at OpenQA and not something that we can modify. Charley's been maintaining our homepages at OpenQA and could tell us for sure. Charley? Bret ___Wtr-general mailing listWtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] JS pop-up trouble, new methods in 1.5.1?
Cut and paste this method in your script exactly as is: # method to click JS popups def startClicker( button , waitTime = 3) w = WinClicker.new longName = $ie.dir.gsub(/ , \\ ) shortName = w.getShortFileName(longName) c = start ruby #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} puts Starting #{c} w.winsystem(c) w=nil end # just before your button that invokes the JS popup put this: startClicker(OK , 3) $ie.button(Submit).click NOTE: I use c = start ruby rather than c = start rubyw because using rubyw rarely, if ever, works for me. Hope this helps, --Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam Reed Sent: Friday, June 16, 2006 11:53 AM To: wtr-general@rubyforge.org Subject: [Wtr-general] JS pop-up trouble, new methods in 1.5.1? I have one test that generates a _javascript_ OK pop-up window that I am unable to close. I have attempted both methods from http://wiki.openqa.org/display/WTR/FAQ to close this window. When using the startClicker method, when the JS pop-up triggers, you can see it lose focus as if startClicker has clicked, just not in the correct place. I found a posting from another Watir user back in February having the same problem and unfortunately he did not receive feedback from other users or a resolution. The code in both of our test cases is verbatim from the FAQ. During my searches for a solution, I also noticed a lot of talk about the 1.5.1 release including some new accepted method for addressing JS functions, but I haven't been able to find out specifically what that is. Is there a new approach I should know about? Thanks in advance, Adam Reed ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] nested frames
How can i discover the names of nested frames with Watir? Thanks- Beth ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] nested frames
ie.frame(:name,foo).show_all_objects frames show up as type HTML. Then if you have a frame called bar you can do ie.frame(:name,foo).frame(:name,bar).show_all_objects On 6/19/06, Beth Ferguson [EMAIL PROTECTED] wrote: How can i discover the names of nested frames with Watir? Thanks- Beth ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Integrating Watir with SQL Server 2000
I'm having a problem with one of the projects i'm handling right now. I was asked to create automation scripts using watir that could also access SQL Server 2000. Can anybody help me out with this??? I've read some of the posts here regarding database connectivity but it doesn't seem to work and I can't figure out how I can make them to work. Please help me out guys. Thanks in advance... Send instant messages to your online friends http://uk.messenger.yahoo.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general