[wtr-general] Issue using .options with select_list
Hi, im getting error as NoMethodError for .option which im using with select_list. i have Ruby 1.8.6 and watir 1.6.2. definitely it is old version but right now i cannot upgrade it due to some limitation for my project. Now i wrote code like this : elems = Array.new values = Array.new elems = $ie.select_list(:id,setTagList).options puts elems 0.upto(elems.length - 1) do |i| values.push elems[i].text end 0.upto(values.length - 1) do |i| puts values[i] if values[i] =~ /DupTags/ returnValue = false else returnValue = true end end But then it shows error that undefined method .options like this : NoMethodError: undefined method `options' for #Watir::SelectList:0xfcc2d4c I also tried like this, but same error : searchList = $ie.select_list(:id,setTagList) selectContent = searchList.options.collect { |option| option.value } So what is the issue here? .option is bydefault method i guess. then why its not working. please help. bhavesh -- -- 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 --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[wtr-general] Issue with .options method with select_list
Hi, Im using Ruby 1.8.6 with Watir 1.6.2 i know its is very old but we have maintained this structure becasue of some reasons. Presently i m getting NOMETHODERROR when i use .options with select_list. Here is my code : elems = Array.new values = Array.new elems = $ie.select_list(:id,setTagList).options puts elems 0.upto(elems.length - 1) do |i| values.push elems[i].text end It shows errros as : NoMethodError: undefined method `options' for #Watir::SelectList:0xfcc2d4c I also tried this : searchList = $ie.select_list(:id,setTagList) selectContent = searchList.options.collect { |option| option.value } Still same error. But .options is supported for select_list, then why im getting this error? Can anyone help? Thanks Bhavesh -- -- 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 --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [wtr-general] Re: Need info about how to get browser version in watir classic and about ie8 and ie9 support.
Thanks Jarmo. Thanks everyone for your comments, by the way we have another UI where we are using watir webdriver. But this is very old ui with no work done and it is left as it is with old version of automation framework. thanks bhavesh On Friday, April 11, 2014 2:44:39 AM UTC+5:30, Jarmo Pertman wrote: You can also use Watir::IE.version or Watir::Browser.version depending of the version of watir/watir-classic used. Jarmo Pertman - IT does really matter - http://itreallymatters.net On Thursday, April 10, 2014 4:51:00 PM UTC+3, Oscar.Rieken wrote: and on a second note I would probably update to more recent versions of ruby/watir imo On Thu, Apr 10, 2014 at 9:50 AM, Oscar Rieken bis...@gmail.com wrote: I personally would just drop down to webdriver and ask it what its caps are [1] pry(main) require 'watir-webdriver' = true [2] pry(main) b = Watir::Browser.new :chrome = #Watir::Browser:0x..f9c0b79e466ac11da url=data:, title=data:, [3] pry(main) b.driver.capabilities = #Selenium::WebDriver::Remote::Capabilities:0x007fa1959cc780 @capabilities= {:browser_name=chrome, :version=33.0.1750.152, :platform=:mac os x, :javascript_enabled=true, :css_selectors_enabled=true, :takes_screenshot=true, :native_events=true, :rotatable=false, :firefox_profile=nil, :proxy=nil, acceptSslCerts=true, applicationCacheEnabled=false, browserConnectionEnabled=false, chrome= {userDataDir= /var/folders/_q/cgwwbx596v995n55n32kd1cmgn/T/.org.chromium.Chromium.rKUMb4}, databaseEnabled=false, handlesAlerts=true, locationContextEnabled=true, takesHeapSnapshot=true, webStorageEnabled=true} On Thu, Apr 10, 2014 at 9:35 AM, Super Kevy kpe...@scholarshipamerica.org wrote: First your running some ancient Ruby and Watir. Consider moving forward. see reference: https://raveendran.wordpress.com/tag/execute_script/ Code for Watir WebDriver IE Browser : require 'rubygems' require 'watir-webdriver' br=Watir::Browser.new :ie ie=br.execute_script(return navigator.userAgent;) puts ie.split(MSIE )[1].split(;)[0] On Wednesday, April 9, 2014 11:39:40 PM UTC-5, Bhavesh wrote: Hi, I have Ruby 1.8.7 with watir 1.6.5. I need following info: 1. How do I get browser version I mean IE version script is running i.e ie7 or ie8 or ie9 etc. 2. I have Ruby 1.8.7 with watir 1.6.5, where I have lot of TC automated. I need to run these testcases in Ie8 and IE9, I know I have tweak my script to run in these browser but does watir 1.6.5 supports ie8 and ie9? I mean it is not like I get errors when I try to run script? Can someone please help me out with this. Thanks Bhavesh -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com http://groups.google.com/group/watir-general watir-genera...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- -- 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 --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [wtr-general] Re: Need info about how to get browser version in watir classic and about ie8 and ie9 support.
Hi Jarmo, I tried using what you said but it throws error. if i use Watir::IE.version, then it throws error for unknown constant version. And if i use Watir::IE::Version then it shows watir version insetad of IE version. And if i use Watir::Browser.version or Watir::Browser::Version the also some error like uninitialized constant Watir::Browser::VERSION etc. So what is the right method to get browser version? Please suggest thanks bhavesh On Friday, April 11, 2014 12:36:39 PM UTC+5:30, Bhavesh wrote: Thanks Jarmo. Thanks everyone for your comments, by the way we have another UI where we are using watir webdriver. But this is very old ui with no work done and it is left as it is with old version of automation framework. thanks bhavesh On Friday, April 11, 2014 2:44:39 AM UTC+5:30, Jarmo Pertman wrote: You can also use Watir::IE.version or Watir::Browser.version depending of the version of watir/watir-classic used. Jarmo Pertman - IT does really matter - http://itreallymatters.net On Thursday, April 10, 2014 4:51:00 PM UTC+3, Oscar.Rieken wrote: and on a second note I would probably update to more recent versions of ruby/watir imo On Thu, Apr 10, 2014 at 9:50 AM, Oscar Rieken bis...@gmail.com wrote: I personally would just drop down to webdriver and ask it what its caps are [1] pry(main) require 'watir-webdriver' = true [2] pry(main) b = Watir::Browser.new :chrome = #Watir::Browser:0x..f9c0b79e466ac11da url=data:, title=data:, [3] pry(main) b.driver.capabilities = #Selenium::WebDriver::Remote::Capabilities:0x007fa1959cc780 @capabilities= {:browser_name=chrome, :version=33.0.1750.152, :platform=:mac os x, :javascript_enabled=true, :css_selectors_enabled=true, :takes_screenshot=true, :native_events=true, :rotatable=false, :firefox_profile=nil, :proxy=nil, acceptSslCerts=true, applicationCacheEnabled=false, browserConnectionEnabled=false, chrome= {userDataDir= /var/folders/_q/cgwwbx596v995n55n32kd1cmgn/T/.org.chromium.Chromium.rKUMb4}, databaseEnabled=false, handlesAlerts=true, locationContextEnabled=true, takesHeapSnapshot=true, webStorageEnabled=true} On Thu, Apr 10, 2014 at 9:35 AM, Super Kevy kpe...@scholarshipamerica.org wrote: First your running some ancient Ruby and Watir. Consider moving forward. see reference: https://raveendran.wordpress.com/tag/execute_script/ Code for Watir WebDriver IE Browser : require 'rubygems' require 'watir-webdriver' br=Watir::Browser.new :ie ie=br.execute_script(return navigator.userAgent;) puts ie.split(MSIE )[1].split(;)[0] On Wednesday, April 9, 2014 11:39:40 PM UTC-5, Bhavesh wrote: Hi, I have Ruby 1.8.7 with watir 1.6.5. I need following info: 1. How do I get browser version I mean IE version script is running i.e ie7 or ie8 or ie9 etc. 2. I have Ruby 1.8.7 with watir 1.6.5, where I have lot of TC automated. I need to run these testcases in Ie8 and IE9, I know I have tweak my script to run in these browser but does watir 1.6.5 supports ie8 and ie9? I mean it is not like I get errors when I try to run script? Can someone please help me out with this. Thanks Bhavesh -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com http://groups.google.com/group/watir-general watir-genera...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- -- 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 --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[wtr-general] Need info about how to get browser version in watir classic and about ie8 and ie9 support.
Hi, I have Ruby 1.8.7 with watir 1.6.5. I need following info: 1. How do I get browser version I mean IE version script is running i.e ie7 or ie8 or ie9 etc. 2. I have Ruby 1.8.7 with watir 1.6.5, where I have lot of TC automated. I need to run these testcases in Ie8 and IE9, I know I have tweak my script to run in these browser but does watir 1.6.5 supports ie8 and ie9? I mean it is not like I get errors when I try to run script? Can someone please help me out with this. Thanks Bhavesh -- -- 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 --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[wtr-general] getting fixnum error for :index in webdriver
Hi I just upgraded to watir webdriver. Using ruby 193. Im using this expression to click on third refresh button in my page : $ie.span(:class = x-btn-icon refresh, :index = 3).click But then it shows me error as : failed expected Fixnum, got 3:String this use to work with my earlier version of watir 1.6.2 and ruby 1.8.7. So what changes i need to do so that this command work and clicks on third refresh button. Any help is apreciated. Thanks bhavesh -- -- 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 --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] page refresh issue in watir script.
Hi, I have script where testcases are defined like this : def test_1012 returnValue = true printTestCaseInfo(SEARCH_0012, Verify Basic Search Results/two terms(NOT)) returnValue = false if !verifyBasicSearch(java.rmi.RemoteException NOT ABCDEF) newUpdateTestingResult(returnValue, WEB_SEARCH, BasicSearch, 1, SEARCH_0012) end def test_1013 returnValue = true printTestCaseInfo(SEARCH_0013, Verify Basic Search Internet Style Plus operator) returnValue = false if !verifyBasicSearch(+ throws java.rmi.RemoteException) newUpdateTestingResult(returnValue, WEB_SEARCH, BasicSearch, 1, SEARCH_0013) end However after each testcases, my webpage get refrshed [i see something like F5]. Verifid all methods, there is no where we have refresh for a page. Then why is it like this? Is it like watir itself refresh page after every testcases? Can someone provide me some thoughts for this? Appriciate your help. Thanks Bhavesh -- -- 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 --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: How to automate sub-menu items using watir.
Im able to click on main menu i.e View. im using like this to click View menu : $ie.frame(:id, 'MainEx_view_0').frame(:id, 'Classic_workarea_0').frame(:id, 'Form_menubar_0').form(:id, 'MenuBar_0').div(:id, 'MenuBar_view_menu_0html_id').click Problem happens when a submenu is generated when i click View main menu. In this submenu, there are other sub options available like Info, register etc, but im not able to click any of it. On Thursday, October 25, 2012 10:15:02 AM UTC-7, RJ wrote: what happens when you invoke the following? browser.div(:id = MenuBar_view_menu_0html_id).fire_event('onclick') -- 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] How to automate sub-menu items using watir.
I have Menus in my applicaiton like File, View etc. When i try clicking View, it generates sub menus which inturns have some suboptions. But im not able to click those sub options. Reason is, when i look into those submenu source code, it appears as : # div id=MenuBar_view_menu_0html_id class=menuBar onmouseout=rolloffMenu('MenuBar_view_menu_0') onmouseover=rolloverMenu('MenuBar_view_menu_0') onclick=popupMenu('MenuBar_view_menu_0') style=height: 18px; width: 50px; cursor: pointer; text-align: center; name=MenuBar_view_menu_0 View div style=position: relative; left: -25px; top: 0pt; width: 0pt; height: 0pt; img id=MenuBar_view_menu_0_anchor height=0 width=0 alt= src=/da/wdk/theme/documentum/images/space.gif /div /div script 1createMenu('MenuBar_view_menu_0','MenuBar_menugroup_0','false','MenuBar_view_menu_0html_id'); 2 3addSubMenu('MenuBar_view_properties_menu_0','MenuBar_view_menu_0','Properties',null); 4 5registerActionControl('__client10_MenuBar_view_info_0','attributes',null,true,false,1,true,'');addMenuItem('__client10_MenuBar_view_info_0','MenuBar_view_properties_menu_0','Info',null,'fireDynamicActionEvent(__client10_MenuBar_view_info_0)',true,true,'P'); /script script type=text/javascript 1registerHotKeyHandler('P', 'fireDynamicActionEvent(__client10_MenuBar_view_info_0)', '__client10_MenuBar_view_info_0'); /script script type=text/javascript 1 2registerActionControl('__client10_MenuBar_view_mbeanresourceattributes_0','mbeanresourceattributes',null,true,false,1,true,'');addMenuItem('__client10_MenuBar_view_mbeanresourceattributes_0','MenuBar_view_properties_menu_0','Attributes',null,'fireDynamicActionEvent(__client10_MenuBar_view_mbeanresourceattributes_0)',true,true,''); /script ### So all subme nu is appearing as registerActionControl, which is i think some java script that gets invoked. Do anyone know how to operate using watir on these controls? thanks Bhavesh -- 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: How to Click on DIV'S having same ID and class.
Thanks Jarmo and Chuck, i will try whatever you provided. I already talked with developer and asked for change. Thanks for your help Bhavesh On May 13, 11:44 am, Chuck van der Linden sqa...@gmail.com wrote: as Jarmo said, the values for id attributes are supposed to be unique, this is defined in the standards for HTML That said, I see no ID attributes present in the HTML samples you provided. You can use the index value if you need to, using something along the lines of browser.div(:text = 'Files_Raj', :index = 1).click but it's not a good idea unless you don't have a better alternative since that sort of code can tend to be a bit brittle and break easily if there are changes to the UI, or the number of elements of that sort are dynamic and may vary over time. The first thing to do is look at things from the perspective of 'how would I know which one to click if using the site manually', then look at the larger HTML picture with that in mind. If the thing you want is inside some other container element that can be easily identified then you can pick it that way. This ends up being more organic as it were, since you are interacting along the same lines as the user. It looks like you have some custom controls here that create what look like list boxes (but are not built off the basic html select control). So are these lists identified somehow? are they nested inside some other div or some container that also contains an identifier? if so find that item, and then select the div you need from within that. This (with made-up class names) might look something like browser.div(:class = 'list header', :text = /the select-list name/).div(:text = 'Files_Raj').click I can't show a specific code example without a larger HTML sample that shows the outer element by which you would know which list you are clicking. On Saturday, May 12, 2012 12:16:39 PM UTC-7, Bhavesh wrote: Hi, I have html code for my application where same DIV class and id for an particular element is appearing twice. or say in 2 places. DIV class=x-combo-list-item _nodup=30811 viewIndex=5Files_Raj/ DIV DIV class=x-combo-list-item _nodup=30811 viewIndex=5Files_Raj/ DIV These are appearing twice, and having same class and index. I have to select the last DIV not the first. How can i acheive this. I tried like this : $_ = $ie.html $b = $ie.html.scan(/DIV class=(x-combo-list-item) _nodup=\S* viewIndex=\\S*\#{subfolders}\/DIV/).flatten rowid = $b[-1].to_s $ie.div(:class = rowid , :index = 5).click But not successfull. it is not clicking the desired element as well as not showing any error. Can anyone know? Bhavesh -- 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] How to Click on DIV'S having same ID and class.
Hi, I have html code for my application where same DIV class and id for an particular element is appearing twice. or say in 2 places. DIV class=x-combo-list-item _nodup=30811 viewIndex=5Files_Raj/ DIV DIV class=x-combo-list-item _nodup=30811 viewIndex=5Files_Raj/ DIV These are appearing twice, and having same class and index. I have to select the last DIV not the first. How can i acheive this. I tried like this : $_ = $ie.html $b = $ie.html.scan(/DIV class=(x-combo-list-item) _nodup=\S* viewIndex=\\S*\#{subfolders}\/DIV/).flatten rowid = $b[-1].to_s $ie.div(:class = rowid , :index = 5).click But not successfull. it is not clicking the desired element as well as not showing any error. Can anyone know? Bhavesh -- 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] watir specific version installtion.
Hi Right now if i install watir gem, it install 3.0.x there is no .exe file too. So is there a way by which we can install specific version of watir? Can we list how many version are available? Please suggest. Bhavesh -- 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: Handling Java script Popup with Ruby in WATIR
If you have autoit installed, then you can create a small script which look for the window title and the button. As soon as that titles window is there, it will clck the button. Sample may be like : require 'win32ole' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do sleep(30) autoit.ControlClick(Microsoft Office Outlook,'', 'OK') autoit.ControlClick(Security Information,'', 'Yes') autoit.ControlClick(Security Alert,'', 'Yes') sleep(20) end Send({SPACE}) rescue Exception = e puts e end Have this script runing when you run your script. Bhavesh On Apr 30, 10:13 am, Chuck van der Linden sqa...@gmail.com wrote: consider moving to watir-webdriver perhaps? On Sunday, April 29, 2012 10:19:33 PM UTC-7, AQUA wrote: No I have been using, WATIR. And the issue I m facing is; basically I have been able to handle the popup using some of the examples available on WATIR wiki. But only with click_no_wait. Whenever I use fire_event the the javascript is executed but the execution flow stuck until I manually click the ok button. Hence the flow never enters the section of the code that is used for handling pop-up without manual interference. Thanks Regards, Manav On Friday, April 27, 2012 1:37:34 PM UTC+5:30, Željko Filipin wrote: On Fri, Apr 27, 2012 at 8:42 AM, AQUA manavkbgu...@gmail.com wrote: I have been working on WATIR for sometimes, but finding issues in handling Java Script pop-ups. If you are using watir-webdriver, this could help: http://watirwebdriver.com/javascript-dialogs/ Ž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: Getting Hash value instead of actual link from email.
Hi Zeljko, Thanks. You are always helpful. I think you are on vacation Yesterday, otherwise i could have done it yesterday. I tried doing the stuff using mail gem, but it didn't worked [Reason is : im not much aware of this gem]. I posted query on ruby mail forum too, but no replies to solve my problem. If i use mail gem, then when i try to access new unread email, it fails, it always returns first mail whether it is read or unread. Here is what i posted on mail forum : ## Hi, I added following code in my WATIR script, and abel to get first email from my Inbox require 'mail' require 'openssl' Mail.defaults do retriever_method :pop3, :address= email.someemail.com, :port = 995, :user_name = 'domain/username', :password = 'pwd', :enable_ssl = true end puts Mail.first I am new to this forum and have following questions : 1. How can I get all the unread emails ? 2. How can I get all links that are present inside emails? or mail message body from the email? 3. Can I click Links present inside an email? [This i can do once i have an link] 4. How can I get emails from a specific folder, if I have subfolders? If some one can help me, then that will be nice. Thanks in advance. Bhavesh ### The webpage for mail gem states that if you use mail.first, it will return first unread email, so oi did that. When i have not received any input/help here, i thought i can use Autoit, to get it working from outlook. With autoit, still im struggling to mark mail as read from unread once i get details [mail body] from the mail. And if i use mail gem, then in that case, im totally stuck. If you can help me on mail gem, with questions i posted, then it will be very helpfull. Also if you tell me how to mark mail as read from unread when i use mail gem. thanks Bhavesh On Apr 25, 12:31 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Wed, Apr 25, 2012 at 5:13 AM, Bhavesh bhavesh1_sha...@yahoo.com wrote: Only thing if someone can help is, i got the email body but as same time i want to mark that email as read instead of unread, so that next time when i have another new email, i get content from that new email and previous all emails are in read state. I guess Chuck is trying to tell you that Watir automates browsers, and you want to automate Outlook. It does not matter if you are using Watir to send mail, you have to use another tool to read mail. Are you aware that you are not using Watir to drive Outlook? (You are using Ruby.) I have done a lot of mail sending/reading/parsing and I would highly suggest that you use another tool (like mail gem) for that, instead of automating Outlook. If you have questions on how to do that, I would be glad to help. Ž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: Getting Hash value instead of actual link from email.
Thanks . I will write the code around and get it working. For subfolders, actually inside Inbox, there are sub folder where specific mails are getting collected based on the policy/rules. That is the reason i need to get the mails from subfolder, but let me try it out. thanks bhavesh On Apr 25, 9:15 am, Željko Filipin zeljko.fili...@gmail.com wrote: Comments are inline. On Wed, Apr 25, 2012 at 5:57 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: I think you are on vacation Yesterday, otherwise i could have done it yesterday. Not on vacation, just really busy. :) If i use mail gem, then when i try to access new unread email, it fails, it always returns first mail whether it is read or unread. As far as I remember, when you get mail via POP3 (as you are doing) there is no way to mark an e-mail message as read. You can just download it and delete it. You should use IMAP if you want to mark message as read. 1. How can I get all the unread emails ? Looks like this should do it: Mail.all More info: http://rubydoc.info/gems/mail/Mail/IMAPhttp://rubydoc.info/gems/mail/Mail/POP3 2. How can I get all links that are present inside emails? I do not think mail gem provides that functionality. or mail message body from the email? mail.body.decoded More info: https://github.com/mikel/mail 3. Can I click Links present inside an email? [This i can do once i have an link] No, but you can save a link in a variable and than open the page with Watir. You have to understand that mail gem and watir gem are really focused. Mail gem just reads, sends and receives mail, does not know anything about browsers or links. Watir gem just drives browsers, does not know anything about e-mail. 4. How can I get emails from a specific folder, if I have subfolders? Do you want to access e-mail messages on a server, or on your local machine? Željko -- 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: Getting Hash value instead of actual link from email.
OK, i will update my query with more details in that forum. On Apr 25, 10:17 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Wed, Apr 25, 2012 at 7:13 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: By the way zeljko, im still not able to get the unread emails if i use Mail.all, mail.first or mail.,last. You will have to provide more information. I am monitoring mail gem list so feel free to post there. Željko -- 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] using .parent to click in UI.
Hi, I have an Table inside which there are entries for folders. I need to select specific folder, but because it is an EXTJS development, all the folders have same div id, spanid, image id etc. Here is the code snippet. # TABLE id=resultTable style=BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px cellSpacing=0 cellPadding=1 TBODY TR TD align=rightSPAN onmouseover=return overlib('Choose what type of repository to show in left data repository list'); onmouseout=nd();Show SELECT id=filter style=BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 100px; BORDER-BOTTOM: 0px onchange=repsSelected_addSourceRepository.filter() name=filterOPTION value=All selectedAll/OPTIONOPTION value=SOURCEONEARCHIVESOURCEONEARCHIVE/OPTION/SELECT /SPANSPAN onmouseover=return overlib('Update the left hand list of repositories'); onmouseout=nd();INPUT class=refresh-true id=refreshButton onclick=repsSelected_addSourceRepository.refresh() type=button /SPAN/TD TD/TD TD/TD TD/TD TD/TD/TR TR TD align=right DIV class=dir-tree-div id=treeView style=TEXT-ALIGN: left DIV class=x-panel x-tree id=ext-comp-1077 style=WIDTH: 400px DIV class=x-panel-bwrap id=ext-gen946 DIV class=x-panel-body x-panel-body-noheader id=ext-gen947 style=OVERFLOW: auto; WIDTH: 400px; HEIGHT: 300px UL class=x-tree-root-ct x-tree-lines id=ext-gen948 DIV class=x-tree-root-node LI class=x-tree-node DIV class=x-tree-node-el x-unselectable x-tree-node-expanded unselectable=on ext:tree-node-id=/Repositories/ES1SPAN class=x- tree-node-indent/SPANIMG class=x-tree-ec-icon x-tree-elbow-end- minus src=https://vm-bhaveshok1/images/c.gif;IMG class=x-tree- node-icon sourceonearchive-icon src=https://vm-bhaveshok1/images/ c.gif unselectable=onA class=x-tree-node-anchor hideFocus tabIndex=1 href=https://vm-bhaveshok1/legal/dashboard.htm#;SPAN unselectable=on ext:qtip=Registered repositories that may added to the right listingES1/SPAN/A/DIV UL class=x-tree-node-ct id=ext-gen1269 style=LEFT: auto; VISIBILITY: visible; POSITION: static; TOP: auto LI class=x-tree-node DIV class=x-tree-node-el x-unselectable x-tree-node-collapsed unselectable=on ext:tree-node-id=/Repositories/ES1/bugfixSPAN class=x-tree-node-indentIMG class=x-tree-icon src=https://vm- bhaveshok1/images/c.gif/SPANIMG class=x-tree-ec-icon x-tree- elbow-plus src=https://vm-bhaveshok1/images/c.gif;IMG class=x-tree- node-icon src=https://vm-bhaveshok1/images/c.gif; unselectable=onA class=x-tree-node-anchor hideFocus tabIndex=1 href=https://vm-bhaveshok1/legal/dashboard.htm#;SPAN unselectable=on ext:qtip=Registered repositories that may added to the right listingbugfix/SPAN/A/DIV UL class=x-tree-node-ct style=DISPLAY: none/UL/LI LI class=x-tree-node DIV class=x-tree-node-el x-unselectable x-tree-node-collapsed unselectable=on ext:tree-node-id=/Repositories/ES1/f_tSPAN class=x-tree-node-indentIMG class=x-tree-icon src=https://vm- bhaveshok1/images/c.gif/SPANIMG class=x-tree-ec-icon x-tree- elbow-plus src=https://vm-bhaveshok1/images/c.gif;IMG class=x-tree- node-icon src=https://vm-bhaveshok1/images/c.gif; unselectable=onA class=x-tree-node-anchor hideFocus tabIndex=1 href=https://vm-bhaveshok1/legal/dashboard.htm#;SPAN unselectable=on ext:qtip=Registered repositories that may added to the right listingf_t/SPAN/A/DIV UL class=x-tree-node-ct style=DISPLAY: none/UL/LI So i have to select folder by name f_T Only thing that i can use is : $ie.span(:text, f_t).click. This works fine. Now my requirement is to click on the image that is appearing just before this folder. Since all the folders have same image, it is very difficult to click on the image that is appearing before to this folder f_t. I tried using : $ie.span(:text,f_t).parent.link(:class, x-tree-node- anchor).parent.div(:class, x-tree-node-el x-unselectable x-tree-node- collapsed).image(:class,x-tree-ec-icon x-tree-elbow-end-plus).click But it fails with error that class x-tree-node-anchor not found. So how can i click on this image which is appearing before the folder f_t. Can some one help me with this? Bhavesh -- 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: Getting Hash value instead of actual link from email.
No..im not using gmail. im using my own corporate emial account. I already posted the query for this on : http://groups.google.com/group/mail-ruby Bhavesh On Apr 25, 10:26 am, Bhavesh bhavesh1_sha...@yahoo.com wrote: OK, i will update my query with more details in that forum. On Apr 25, 10:17 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Wed, Apr 25, 2012 at 7:13 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: By the way zeljko, im still not able to get the unread emails if i use Mail.all, mail.first or mail.,last. You will have to provide more information. I am monitoring mail gem list so feel free to post there. Željko -- 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] Need help in Invoking multiple IE's
Hi, I have watir installed. Im starting 1 IE sesion afor my webapplication and soing some stuff. At the same time in paralle, i need to invoke 1 more IE. do some stuff there. Once done close this IE and attach to the previous IE. Will it be possible? Code snippet : # def test $ie = Watir::IE.new() $ie.goto($someLink) some porcessijg here Now open another IE $ie1 = Watir::IE.new() $ie1.goto($someaddress) some more processing on this new IE $ie1.close $ie.attach(/previous IE/) $ie.close end ### But this fails, it opens first IE, but then nothing being done. so it is possible to automate such scenarios? Thanks Bhavesh -- 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] Getting Hash value instead of actual link from email.
Hi, Im trying to access links inside an email. Im am not using Gem “mail”. Im doing very simple stuff here. Just getting unread email from the mailbox and then getting the links present inside that email. When I try to get email bocdy, I get without error. But similarly when I try to get links present inside that email, it shows Hash value instead of actual links. Code is : #Getting email body/Links of unread email inbox = mapi.GetDefaultFolder(6) inbox.Items.each do |message| #puts message.body if message.Unread puts message.Links if message.Unread What I have to change to get the actual links. Bhavesh -- 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: Getting Hash value instead of actual link from email.
Yes, im doing this in watir. Instead of using mail gem, im using this method to retrive emails. I dont want to install gem mail. I need to know how to get values instead of these hash values. Bhavesh On Apr 24, 1:36 pm, Chuck van der Linden sqa...@gmail.com wrote: The mail gem has it's own google group, the link is in the readme look here: https://github.com/mikel/mail/ That would be the better place to ask your question On Tuesday, April 24, 2012 1:32:00 PM UTC-7, Chuck van der Linden wrote: I see no watir in your code below, why are you posting this question here? On Tuesday, April 24, 2012 1:28:08 PM UTC-7, Bhavesh wrote: Hi, Im trying to access links inside an email. Im am not using Gem “mail”. Im doing very simple stuff here. Just getting unread email from the mailbox and then getting the links present inside that email. When I try to get email bocdy, I get without error. But similarly when I try to get links present inside that email, it shows Hash value instead of actual links. Code is : #Getting email body/Links of unread email inbox = mapi.GetDefaultFolder(6) inbox.Items.each do |message| #puts message.body if message.Unread puts message.Links if message.Unread What I have to change to get the actual links. Bhavesh -- 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: Getting Hash value instead of actual link from email.
Hi Chuck, I don't expect people to write an code for me. I have already posted the code which i am using in my script in my first Post. Code is : outlook = WIN32OLE.new('Outlook.Application') mapi = outlook.GetNameSpace('MAPI') folders = mapi.Folders new_messages = 0 #Getting email body/Links of unread email inbox = mapi.GetDefaultFolder(6) inbox.Items.each do |message| #puts message.body if message.Unread puts message.Links if message.Unread This is all i am doing. And it is working too I have Outlook opened and it is retriving first unread emial which i want. So i have written an code and it is working. Question is, when i try to retrive email body, it works and retrive it without error. But when i try to retrive links which are in email, it shows Hash values instead of actual links. Here is the output : #WIN32OLE:0x171bda8 . Finished in 0.812500 seconds. So i have a doubt, im not clear and therefore im putting my question. i dont expect anybody to write me a code. I clearly written in my Post that im not using mail gem, im doing normal stuf related with emails. I hope that explains my concerns. thanks bhavesh On Apr 24, 2:14 pm, Chuck van der Linden sqa...@gmail.com wrote: Then show us some example HTML and some code that is using watir that shows what you are trying to do. I have for example zero idea what mail system you are even trying to access, you've given us pretty much zero info other than the code you want to replace (which itself has very little info we could infer). if you are expecting the folks here to write your code for you, that's not going to happen. we'll provide guidance, advice, and try to get you unstuck etc. but we're not going to port code from some other gem over to use watir starting from nothing. Nearly all of us have our hands full doing our own work, and little time to do someone elses work for free. If you have not already done so, spend some time in the watir tutorialhttp://wiki.openqa.org/display/WTR/Tutorial or with the Watir Bookhttp://watir.com/book/(which tends to be more current than the wiki tutorial) to get you started. On Tuesday, April 24, 2012 1:49:14 PM UTC-7, Bhavesh wrote: Yes, im doing this in watir. Instead of using mail gem, im using this method to retrive emails. I dont want to install gem mail. I need to know how to get values instead of these hash values. Bhavesh On Apr 24, 1:36 pm, Chuck van der Linden sqa...@gmail.com wrote: The mail gem has it's own google group, the link is in the readme look here: https://github.com/mikel/mail/ That would be the better place to ask your question On Tuesday, April 24, 2012 1:32:00 PM UTC-7, Chuck van der Linden wrote: I see no watir in your code below, why are you posting this question here? On Tuesday, April 24, 2012 1:28:08 PM UTC-7, Bhavesh wrote: Hi, Im trying to access links inside an email. Im am not using Gem “mail”. Im doing very simple stuff here. Just getting unread email from the mailbox and then getting the links present inside that email. When I try to get email bocdy, I get without error. But similarly when I try to get links present inside that email, it shows Hash value instead of actual links. Code is : #Getting email body/Links of unread email inbox = mapi.GetDefaultFolder(6) inbox.Items.each do |message| #puts message.body if message.Unread puts message.Links if message.Unread What I have to change to get the actual links. Bhavesh -- 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: Getting Hash value instead of actual link from email.
Hi chuck, You are still not getting me. Im am using Watir, and an webapplicaiton. From my application, i can send notification. Once notification is received in Outlook Inbox, i have to get the links in that emails. I automated using Watir till i can send the notification on an web application. I have written code to get emails also from the Outlook in watir script [which i have pasted in last thread]. Now im getting some different result which i dont understand as why hash value is returned instead of actual links. Hence i posted the query in Watir forum. This thread is now going in some different direction instead of my problem. Since im not using mail gem, i cannot post an query to ruby-mail forum. this is simple WATIR script. Here is the Snapshot of the full script. ## # encoding: utf-8 $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../..') if $0 == __FILE__ require 'Lib/KazeonCommon/BasicMethodLibrary' require 'Lib/KazeonCommon/LegalUIMethodLibrary' require 'Lib/KazeonCommon/WebAutosetup.rb' class Mail Test::Unit::TestCase def test_0010 $ie.goto($legalLink) sleep(5) kazeonLegalLogin(LEGALUI,domain=Local, loginName=legaladmin) #kazeonLegalLogin(LEGALUI,domain=Local, loginName=legaladmin) sleep(10) printTestCaseInfo(LEGALUI0007, create a case with case id, status 'open', value in Description and value in Responsible Attorney) #puts Select and add reviewers in legal # $ie.div(:class = x-grid3-cell-inner x-grid3-col- reviewername, :text = bhavesh).click # sleep(5) # $ie.link(:id, button2).click # sleep(5) sleep(5) puts Select Active Case selectActiveCase(case4) clickOkButton() puts Select Notify Custodian Button $_ = $ie.html $ie.button(:class, x-btn-text sendemail).click sleep(5) puts Select Add Receipient Button $ie.button(:class = x-btn-text addReviewer, :index = 2).click sleep(5) puts Select Non Ad User Radio Button $ie.radio(:value, nonADUser).click sleep(5) puts Enter Username $ie.text_field(:id, lookupFilter).set(bhavesh.sha...@emc.com) sleep(5) puts Click Go Button #$ie.link(:id, getData).click sleep(5) puts Select User $ie.div(:class = x-grid3-cell-inner x-grid3-col-2, :text = bhavesh.sha...@emc.com).flash sleep(2) $ie.div(:class = x-grid3-cell-inner x-grid3-col-2, :text = bhavesh.sha...@emc.com).left_click sleep(5) puts Select Add selected Button $ie.button(:value, Add Selected).click sleep(3) puts Select Close Button $ie.button(:value, Close).click sleep(5) puts Select Send Notification button $ie.button(:text, Send Notifications).click sleep(10) puts Done outlook = WIN32OLE.new('Outlook.Application') mapi = outlook.GetNameSpace('MAPI') folders = mapi.Folders new_messages = 0 #Getting email body of unred email inbox = mapi.GetDefaultFolder(6) inbox.Items.each do |message| #puts message.body if message.Unread puts message.Links if message.Unread end end end ## Last line im getting unexpected result, for which i posted the query. I dont want to put all code in the post, otherwise it is very big . I hope im clear this time. bhavesh On Apr 24, 4:03 pm, Chuck van der Linden sqa...@gmail.com wrote: There is not a single line of code in what you provided below that is using Watir. Watir is Web Application Testing in Ruby, it is for driving web browsers and automating web applications. I have outlook open Outlook is a native application, not a web application. YOU CANNOT DRIVE OUTLOOK WITH WATIR There is 'OWA or Outlook Web Access' but I can tell you are not using it because of this line of ruby code WIN32OLE.new('Outlook.Application') You need to ask questions of this sort in a more general forum for ruby, or perhaps on stackoverflow with appropriate tags (such as 'ruby' and 'mapi' ) If you were using watir, and a web application we'd be glad to help you. but you are not using watir, nor are you using a web application, so this is not the place to ask for help with the problems you are having I'd suggest doing some Ruby tutorials, or perhaps getting a good book on basic ruby scripting such as 'everyday scripting in ruby' you can get it as an ebook and be working on it minutes after you buy it. On Tuesday, April 24, 2012 3:44:45 PM UTC-7, Bhavesh wrote: Hi Chuck, I don't expect people to write an code for me. I have already posted the code which i am using in my script in my first Post. Code is : outlook = WIN32OLE.new('Outlook.Application
[wtr-general] Re: Getting Hash value instead of actual link from email.
OK, i got the solution. I pattern matched the link text from the message body. After grabbing the link text, i can use it to navigate. So all ok now. Only thing if someone can help is, i got the email body but as same time i want to mark that email as read instead of unread, so that next time when i have another new email, i get content from that new email and previous all emails are in read state. Does anyone knows it? Bhavesh On Apr 24, 4:31 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi chuck, You are still not getting me. Im am using Watir, and an webapplicaiton. From my application, i can send notification. Once notification is received in Outlook Inbox, i have to get the links in that emails. I automated using Watir till i can send the notification on an web application. I have written code to get emails also from the Outlook in watir script [which i have pasted in last thread]. Now im getting some different result which i dont understand as why hash value is returned instead of actual links. Hence i posted the query in Watir forum. This thread is now going in some different direction instead of my problem. Since im not using mail gem, i cannot post an query to ruby-mail forum. this is simple WATIR script. Here is the Snapshot of the full script. ## # encoding: utf-8 $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../..') if $0 == __FILE__ require 'Lib/KazeonCommon/BasicMethodLibrary' require 'Lib/KazeonCommon/LegalUIMethodLibrary' require 'Lib/KazeonCommon/WebAutosetup.rb' class Mail Test::Unit::TestCase def test_0010 $ie.goto($legalLink) sleep(5) kazeonLegalLogin(LEGALUI,domain=Local, loginName=legaladmin) #kazeonLegalLogin(LEGALUI,domain=Local, loginName=legaladmin) sleep(10) printTestCaseInfo(LEGALUI0007, create a case with case id, status 'open', value in Description and value in Responsible Attorney) #puts Select and add reviewers in legal # $ie.div(:class = x-grid3-cell-inner x-grid3-col- reviewername, :text = bhavesh).click # sleep(5) # $ie.link(:id, button2).click # sleep(5) sleep(5) puts Select Active Case selectActiveCase(case4) clickOkButton() puts Select Notify Custodian Button $_ = $ie.html $ie.button(:class, x-btn-text sendemail).click sleep(5) puts Select Add Receipient Button $ie.button(:class = x-btn-text addReviewer, :index = 2).click sleep(5) puts Select Non Ad User Radio Button $ie.radio(:value, nonADUser).click sleep(5) puts Enter Username $ie.text_field(:id, lookupFilter).set(bhavesh.sha...@emc.com) sleep(5) puts Click Go Button #$ie.link(:id, getData).click sleep(5) puts Select User $ie.div(:class = x-grid3-cell-inner x-grid3-col-2, :text = bhavesh.sha...@emc.com).flash sleep(2) $ie.div(:class = x-grid3-cell-inner x-grid3-col-2, :text = bhavesh.sha...@emc.com).left_click sleep(5) puts Select Add selected Button $ie.button(:value, Add Selected).click sleep(3) puts Select Close Button $ie.button(:value, Close).click sleep(5) puts Select Send Notification button $ie.button(:text, Send Notifications).click sleep(10) puts Done outlook = WIN32OLE.new('Outlook.Application') mapi = outlook.GetNameSpace('MAPI') folders = mapi.Folders new_messages = 0 #Getting email body of unred email inbox = mapi.GetDefaultFolder(6) inbox.Items.each do |message| #puts message.body if message.Unread puts message.Links if message.Unread end end end ## Last line im getting unexpected result, for which i posted the query. I dont want to put all code in the post, otherwise it is very big . I hope im clear this time. bhavesh On Apr 24, 4:03 pm, Chuck van der Linden sqa...@gmail.com wrote: There is not a single line of code in what you provided below that is using Watir. Watir is Web Application Testing in Ruby, it is for driving web browsers and automating web applications. I have outlook open Outlook is a native application, not a web application. YOU CANNOT DRIVE OUTLOOK WITH WATIR There is 'OWA or Outlook Web Access' but I can tell you are not using it because of this line of ruby code WIN32OLE.new('Outlook.Application') You need to ask questions of this sort in a more general forum for ruby, or perhaps on stackoverflow with appropriate tags (such as 'ruby' and 'mapi' ) If you were using watir, and a web application we'd be glad to help you. but you are not using
[wtr-general] Need information on Accessing outlook and emails for multiple mailboxes
Hi, We need to automate notification functionality for our project. Email are sent from the server to the email user/s. We have to verify after email is revieved, what is the body content, at what time it is received, we have to click on a link that is present inside the email. We have to repeat this with multiple mailboxes. I have created a script to access mailbox, where outlook needs to be opened always and then we can access the mailbox, folders inside it. Can someone let me know, following : 1. Is it possible to access multiple mailboxes? if in my outlook i open mailtiple mailboxes. 2. Is it possible to access various folders, inside multiple mailboxes? 3. How to click Link which is inside the mail ? Do anyone have written any code for it and if anyone can share the code snippet that will be nice? Or may be direct me to some help page where i can found all the detials regarding accessing mailbox/s from WATIR. thanks Bhavesh -- 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: Saving a PDF with Watir
Hi Chuck, Here what ever you are saying make sense, even i have gonbe through the link you proposed. But what in case if you dont have a http address? In my case for download, a additional IE window by title File Download gets opened, now i can click on save button on this window.this open another IE window by title Save As. Now here i have to click on Desktop tab, and then have to save the file. everything in IE. How can i achieve this? Also is there any way by whoch we can unzip OR see the files inside the zip? Bhavesh On Apr 10, 11:16 am, Chuck van der Linden sqa...@gmail.com wrote: So is your job to test that IE can properly save a file, or that the PDF viewer can properly save a file? How many PDF viewers will you test? (there are more than just adobe's you know) and what value is testing someone-elses stuff bringing to your employer? Or is your objective to determine if the server has the proper PDF file and serves it correctly? If the objective is the latter, then you might just want to see if you use Watir to find the URL in the link, then briefly bypass the browser and download the file. If you can show us a HTML sample we can guide you in how you would go about determining the link for the PDF file. Once you have that, you could make a direct HTTP request for the file using standard HTTP support built into ruby via net/http. See this StackOverflow question for examples of code that would directly download a file using http presuming you know the URL of the file. http://stackoverflow.com/q/2263540/409820 On Tuesday, April 10, 2012 7:50:59 AM UTC-7, Nicolas Turelier wrote: Thanks a lot, but the problem is that all of my tests are only for IE, this is a specification I can't sidestep :s Le mardi 10 avril 2012 15:49:38 UTC+2, Željko Filipin a écrit : On Tue, Apr 10, 2012 at 3:35 PM, Nicolas Turelier nicolas.turel...@gmail.com wrote: The PDF in the popup is opened with the Acrobat Reader interface and I have to save this PDF in a specific folder on my HardDrive. The easiest thing to do is to disable the PDF reader. This is how to do it in Chrome: require watir-webdriver browser = Watir::Browser.new :chrome # disable Chrome PDF Viewer browser.goto about:plugins browser.span(:text = Chrome PDF Viewer).parent.parent.parent.a(:text = Disable, :class = disable-group-link).click Then just do what is needed for the popup to appear, and Chrome should download the file to Downloads folder. Ž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] Need information on Accessing outlook and emails for multiple mailboxes
Hi, We need to automate notification functionality for our project. Email are sent from the server to the email user/s. We have to verify after email is revieved, what is the body content, at what time it is received, we have to click on a link that is present inside the email. We have to repeat this with multiple mailboxes. I have created a script to access mailbox, where outlook needs to be opened always and then we can access the mailbox, folders inside it. Can someone let me know, following : 1. Is it possible to access multiple mailboxes? if in my outlook i open mailtiple mailboxes. 2. Is it possible to access various folders, inside multiple mailboxes? 3. How to click Link which is inside the mail ? Do anyone have written any code for it and if anyone can share the code snippet that will be nice? Or may be direct me to some help page where i can found all the detials regarding accessing mailbox/s from WATIR. thanks Bhavesh -- 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: Need information on Accessing outlook and emails for multiple mailboxes
Thanks for your help Zeljko. On Apr 13, 9:25 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Fri, Apr 13, 2012 at 6:02 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: We have to verify after email is revieved, what is the body content, at what time it is received, we have to click on a link that is present inside the email. I usually use mail gem for that: https://rubygems.org/gems/mail Ž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: EXTJS Issue - Problem with watir 1.8.1, but works with watir webdriver.
Any body can help on this? On Apr 12, 12:26 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Same issue, even if i upgrade the watir gem version to 2.0.4. It still fails but works with watir webdriver. On Apr 12, 12:24 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi, I have a lookup pop-up window. In this windows, everything is under different tables. All the code is in EXTJS, so all are dynamic ids. Code snippet : # TABLE class=x-grid3-row-table style=WIDTH: 290px cellSpacing=0 cellPadding=0 border=0 TBODY TR TD class=x-grid3-col x-grid3-cell x-grid3-td-checker x-grid3-cell- first style=WIDTH: 20px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-checker unselectable=on DIV class=x-grid3-row-checker /DIV/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-AccName style=DISPLAY: none; WIDTH: 100px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-AccName unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-2 style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-2 unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-3 style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-3 unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-4 x-grid3-cell-last style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-4 unselectable=on /DIV/TD/TR/TBODY/TABLE/DIV/DIVA class=x-grid3-focus id=ext-gen971 tabIndex=-1 href=https://vm-shivok1/ legal/dashboard.htm#/A/DIV/DIV DIV class=x-grid3-resize-marker id=ext-gen973 /DIV DIV class=x-grid3-resize-proxy id=ext-gen974 /DIV/DIV/ DIV/DIV/DIV/DIV/TD/TR TR TD height=5 /TD/TR TR TD align=middleINPUT id=new style=WIDTH: 30% onclick=addADToSelectedRecipients(addatagrid); type=button value=Add Selected INPUT id=new style=WIDTH: 30% onclick=win_adLookup.close() type=button value=Close /TD/TR TR TD height=10 /TD/TR/TBODY/TABLE/DIV/DIV/DIV/ DIV ## I have to click on 1 checkbox, which appears as an checkbox in UI, but internally it is something else. If i use simple watir script to click on this checkbox, it fails with error that element is not visible. but when i try the same code with watir webdriver, it works. code is : $ie.div(:class = x-grid3-cell-inner x-grid3-col-2, :text = s...@emc.com).click Can someone tell me what changes i shd do , so that this code works without webdriver too? thanks Bhavesh -- 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: Need information on Accessing outlook and emails for multiple mailboxes
Hi Zeljko, If i use mail gem, can i access emails, links inside it when outlook is opened and active? Reason im asking is i have an outlook, but i dont have an PST path for it. The link which you sent talks about providing the path to email/msg etc and then accessing that object. In my case i dont have PST, or path to object, just i have outlook opened and all emails are preent insdie a folder Inbox or in some subfolders. Please suggest. Bhavesh On Apr 13, 12:59 pm, Chuck van der Linden sqa...@gmail.com wrote: Do you know about the gmail 'plus' trick? the plus sign an anything after it is just ignored.. So 'testinginbox+vuse...@gmail.com = testingin...@gmail.com but you can tell where it was sent (thus who sent it) Lets you route mail from a lot of sources, each somewhat traceable back to its source, all to one inbox On Friday, April 13, 2012 11:12:03 AM UTC-7, Bhavesh wrote: Thanks for your help Zeljko. On Apr 13, 9:25 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Fri, Apr 13, 2012 at 6:02 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: We have to verify after email is revieved, what is the body content, at what time it is received, we have to click on a link that is present inside the email. I usually use mail gem for that: https://rubygems.org/gems/mail Ž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: Need information on Accessing outlook and emails for multiple mailboxes
And is it possible to click on link inside an email? On Apr 13, 2:52 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi Zeljko, If i use mail gem, can i access emails, links inside it when outlook is opened and active? Reason im asking is i have an outlook, but i dont have an PST path for it. The link which you sent talks about providing the path to email/msg etc and then accessing that object. In my case i dont have PST, or path to object, just i have outlook opened and all emails are preent insdie a folder Inbox or in some subfolders. Please suggest. Bhavesh On Apr 13, 12:59 pm, Chuck van der Linden sqa...@gmail.com wrote: Do you know about the gmail 'plus' trick? the plus sign an anything after it is just ignored.. So 'testinginbox+vuse...@gmail.com = testingin...@gmail.com but you can tell where it was sent (thus who sent it) Lets you route mail from a lot of sources, each somewhat traceable back to its source, all to one inbox On Friday, April 13, 2012 11:12:03 AM UTC-7, Bhavesh wrote: Thanks for your help Zeljko. On Apr 13, 9:25 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Fri, Apr 13, 2012 at 6:02 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: We have to verify after email is revieved, what is the body content, at what time it is received, we have to click on a link that is present inside the email. I usually use mail gem for that: https://rubygems.org/gems/mail Ž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] EXTJS Issue - Problem with watir 1.8.1, but works with watir webdriver.
Hi, I have a lookup pop-up window. In this windows, everything is under different tables. All the code is in EXTJS, so all are dynamic ids. Code snippet : # TABLE class=x-grid3-row-table style=WIDTH: 290px cellSpacing=0 cellPadding=0 border=0 TBODY TR TD class=x-grid3-col x-grid3-cell x-grid3-td-checker x-grid3-cell- first style=WIDTH: 20px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-checker unselectable=on DIV class=x-grid3-row-checker /DIV/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-AccName style=DISPLAY: none; WIDTH: 100px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-AccName unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-2 style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-2 unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-3 style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-3 unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-4 x-grid3-cell-last style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-4 unselectable=on /DIV/TD/TR/TBODY/TABLE/DIV/DIVA class=x-grid3-focus id=ext-gen971 tabIndex=-1 href=https://vm-shivok1/ legal/dashboard.htm#/A/DIV/DIV DIV class=x-grid3-resize-marker id=ext-gen973 /DIV DIV class=x-grid3-resize-proxy id=ext-gen974 /DIV/DIV/ DIV/DIV/DIV/DIV/TD/TR TR TD height=5 /TD/TR TR TD align=middleINPUT id=new style=WIDTH: 30% onclick=addADToSelectedRecipients(addatagrid); type=button value=Add Selected INPUT id=new style=WIDTH: 30% onclick=win_adLookup.close() type=button value=Close /TD/TR TR TD height=10 /TD/TR/TBODY/TABLE/DIV/DIV/DIV/ DIV ## I have to click on 1 checkbox, which appears as an checkbox in UI, but internally it is something else. If i use simple watir script to click on this checkbox, it fails with error that element is not visible. but when i try the same code with watir webdriver, it works. code is : $ie.div(:class = x-grid3-cell-inner x-grid3-col-2, :text = s...@emc.com).click Can someone tell me what changes i shd do , so that this code works without webdriver too? thanks Bhavesh -- 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: EXTJS Issue - Problem with watir 1.8.1, but works with watir webdriver.
Same issue, even if i upgrade the watir gem version to 2.0.4. It still fails but works with watir webdriver. On Apr 12, 12:24 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi, I have a lookup pop-up window. In this windows, everything is under different tables. All the code is in EXTJS, so all are dynamic ids. Code snippet : # TABLE class=x-grid3-row-table style=WIDTH: 290px cellSpacing=0 cellPadding=0 border=0 TBODY TR TD class=x-grid3-col x-grid3-cell x-grid3-td-checker x-grid3-cell- first style=WIDTH: 20px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-checker unselectable=on DIV class=x-grid3-row-checker /DIV/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-AccName style=DISPLAY: none; WIDTH: 100px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-AccName unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-2 style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-2 unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-3 style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-3 unselectable=ons...@emc.com/DIV/TD TD class=x-grid3-col x-grid3-cell x-grid3-td-4 x-grid3-cell-last style=WIDTH: 90px tabIndex=0 DIV class=x-grid3-cell-inner x-grid3-col-4 unselectable=on /DIV/TD/TR/TBODY/TABLE/DIV/DIVA class=x-grid3-focus id=ext-gen971 tabIndex=-1 href=https://vm-shivok1/ legal/dashboard.htm#/A/DIV/DIV DIV class=x-grid3-resize-marker id=ext-gen973 /DIV DIV class=x-grid3-resize-proxy id=ext-gen974 /DIV/DIV/ DIV/DIV/DIV/DIV/TD/TR TR TD height=5 /TD/TR TR TD align=middleINPUT id=new style=WIDTH: 30% onclick=addADToSelectedRecipients(addatagrid); type=button value=Add Selected INPUT id=new style=WIDTH: 30% onclick=win_adLookup.close() type=button value=Close /TD/TR TR TD height=10 /TD/TR/TBODY/TABLE/DIV/DIV/DIV/ DIV ## I have to click on 1 checkbox, which appears as an checkbox in UI, but internally it is something else. If i use simple watir script to click on this checkbox, it fails with error that element is not visible. but when i try the same code with watir webdriver, it works. code is : $ie.div(:class = x-grid3-cell-inner x-grid3-col-2, :text = s...@emc.com).click Can someone tell me what changes i shd do , so that this code works without webdriver too? thanks Bhavesh -- 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] need help on table rows columns operations
Hi, How can i operate on cells on the table. I have 1 table, inside that i have many columns and multiple rows like : ID CaseName Status Activities CreationDate Supervisor Actions 1 Deere vs. Michigan StateOpen Completed 2 abc vs. abc State ClosedCompleted Code for this table is as below. I want to operate on various rows value here in this table like if status for a particular case is Open, when i know the caseName. OR if i have to click on various status for a paritular case like for case Deere vs. Michigan State i would like to click on Actions or get the value of colum status for this particular case. Can some one help me how to i do this? how can i get the particular values of the column for the said case, when i know the casename ? Thanks Bhavesh TABLE class=display id=example1 style=MARGIN-LEFT: 0px; WIDTH: 1200px THEAD TR style=HEIGHT: 0px TH class=sorting style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 36px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=1/TH TH class=gridCaseNameData sorting_asc style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 243px; PADDING- TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=2/TH TH class=sorting style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 64px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=3/TH TH class=center sorting style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM- WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 75px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=4/TH TH class=sorting style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 86px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=5/TH TH class=sorting style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 217px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=6/TH TH class=center gridReviewersData sorting style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 83px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=7/TH TH class=center gridCustodiansData sorting style=BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 87px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=8/TH TH class=gridActions sorting style=BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; WIDTH: 210px; PADDING-TOP: 0px; HEIGHT: 0px jQuery17104475470988204742=9/TH/TR/THEAD TBODY TR class=odd TD3/TD TD class=gridCaseNameData sorting_1 jQuery17104475470988204742=10A href=http://vm- bhaveshok2.kazeon.local/xgui/#Deere vs. Michigan State/A/TD TDOpen/TD TD class=centerA href=http://vm-bhaveshok2.kazeon.local/xgui/ #IMG alt=Completed src=http://vm-bhaveshok2.kazeon.local/xgui/ resources/images/status_green.gif border=0/A/TD TDAlex/TD TD11-15-2011 06:09 PM PDT/TD TD class=center gridReviewersData jQuery17104475470988204742=21A href=http://vm- bhaveshok2.kazeon.local/xgui/#12/A/TD TD class=center gridCustodiansData jQuery17104475470988204742=32A href=http://vm- bhaveshok2.kazeon.local/xgui/#122/A/TD TD class=gridActionsSELECT id=jumpMenu onchange= name=jumpMenu OPTION value=# selected- Select -/OPTION OPTION value=#View Case Details/OPTION OPTION value=#Edit Case Details/OPTION OPTION value=#Add Collection/OPTION OPTION value=#Add Notes/OPTION OPTION value=#Manage Activities/OPTION OPTION value=#Manage Reports/OPTION OPTION value=#Manage Custodians/OPTION OPTION value=#Process/OPTION OPTION value=#Export Privilege Log/OPTION OPTION value=#Close Case/OPTION OPTION value=#Delete Case/ OPTION/SELECT/TD/TR TR class=even TD2/TD TD class=gridCaseNameData sorting_1 jQuery17104475470988204742=11A href=http://vm- bhaveshok2.kazeon.local/xgui/#abc vs. abc State/A/TD TDOpen/TD TD class=centerA href=http://vm-bhaveshok2.kazeon.local/xgui/ #IMG alt=Completed src=http://vm-bhaveshok2.kazeon.local/xgui/ resources/images/status_green.gif border=0/A/TD TDAlex/TD TD11-16-2011 06:00 PM PDT/TD TD class=center gridReviewersData jQuery17104475470988204742=22A href=http://vm- bhaveshok2.kazeon.local/xgui/#02/A/TD TD class=center gridCustodiansData jQuery17104475470988204742=33A href=http://vm- bhaveshok2.kazeon.local/xgui/#412/A/TD TD class=gridActionsSELECT id=jumpMenu onchange= name=jumpMenu OPTION value=# selected- Select -/OPTION OPTION value=#View Case Details/OPTION OPTION value=#Edit Case Details/OPTION OPTION value=#Add Collection/OPTION OPTION value=#Add Notes/OPTION OPTION value=#Manage Activities/OPTION OPTION value=#Manage Reports/OPTION OPTION value=#Manage Custodians/OPTION OPTION value=#Process/OPTION OPTION value=#Export Privilege Log/OPTION OPTION value=#Close Case/OPTION OPTION value=#Delete Case/ OPTION/SELECT/TD/TR TR class=odd TD4/TD TD class=gridCaseNameData sorting_1 jQuery17104475470988204742=12A href=http://vm- bhaveshok2.kazeon.local/xgui/#John vs
[wtr-general] Re: Not able to select table data inside an table which is having no unique identity.
Yes, i see 3 table by that name grid-btable. irb(main):004:0 browser.tables(:class, grid-btable).size = 3 I tried below with index as 1, 2 and 3, but evertime it failed : $ie.table(:class = grid-btable, :index = 1).div(:class, comboboxpp).td(:text, 'Summary').click failed unable to locate element, using {:text=Summary, :tag_name=td} Im not getting how cna i select element from that combo box now? Bhavesh On Jan 18, 2:43 pm, Chuck van der Linden sqa...@gmail.com wrote: For the first three things you listed, I see nothing with 'reportType' listed in the HTML you posted, so I have no idea what those are trying to do. For the the next three things you list, There's more than one table row in that table with the class of item which would cause two of those three to fail because they would be looking in the row wrapped around the 'Summary' cell and thus unable to find within that row a cell with text 'Detail' However on the face of things, this one here should have worked. $ie.table(:class, grid-btable).div(:class, comboboxpp).td(:text, 'Detail').click Knowing the exact error given for that one might be useful Looking at the entire HTML are you sure that the 'grid-btable' class is unique? and that within that the class 'comboboxpp' is also unique? by the looks of the HTML you may have a lot of nested tables there (I see two implicit and one inferred in the HTML you presented so it may be that you are having an issue getting the right instance of one of those. an easy way to test for this is to try something like this from an IRB prompt when you are on the right page $ie.tables(:class, grid-btable).size If there is only one, the size will be 1, if there's more than one, then that could be your problem. On Jan 17, 3:42 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi, I have table, inside it i have table row, which interm have data [text] as Summary and Detail. Source code from IE is : TABLE class=grid-btable cellSpacing=0 cellPadding=0 width=100% border=0 TBODY id=z_f2_rh TR class=grid id=z_f2_sh style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Grw z.rid=z_f2_4g z.inited=true TD class=gc id=z_f2_th!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_th!cellSPAN id=z_f2_th style=WIDTH: 115pxName:/SPAN/DIV/TD TD class=gc id=z_f2_vh!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_vh!cellINPUT class=text id=z_f2_vh style=WIDTH: 450px maxLength=100 z.type=zul.widget.Txbox/DIV/TD TD class=gc id=z_f2_uh!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_uh!cellSPAN id=z_f2_uh style=WIDTH: 115px(Limit 100 characters)/SPAN/DIV/TD/TR TR class=grid odd id=z_f2_0i style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Grw z.rid=z_f2_4g z.inited=true TD class=gc id=z_f2_1i!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_1i!cellSPAN id=z_f2_1i style=WIDTH: 115pxType:/SPAN/DIV/TD TD class=gc id=z_f2_4i!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_4i!cellSPAN class=combobox id=z_f2_4i z.type=zul.cb.Cmbox z.combo=trueINPUT class=comboboxinp readonly id=z_f2_4i!real readOnly value=Summary autocomplete=offSPAN class=rbtnbk id=z_f2_4i!btn style=PADDING- BOTTOM: 2px; PADDING-TOP: 3px; POSITION: relative; TOP: 1pxIMG src=https://vm-bhaveshok2.kazeon.local/reports/zkau/web/zul/img/ combobtn.gif/SPAN DIV class=comboboxpp id=z_f2_4i!pp style=DISPLAY: none tabIndex=-1 TABLE id=z_f2_4i!cave cellSpacing=0 cellPadding=0 TBODY TR class=item id=z_f2_2i z.type=Cmit z.disd=false TD/TD TDSummary/TD/TR TR class=item id=z_f2_3i z.type=Cmit z.disd=false TD/TD TDDetail/TD/TR/TBODY/TABLE/DIV/SPAN/DIV/TD/TR Im looking at last 8 lines. There is no name, class for this table. only there is dynamic id generated. I want to select text Detail: out of this combobox. Can someone help how can i do it. Im using watir webdriver. I tried like : $ie.table(:class, grid-btable).cell(:class = item, :text = reportType).click $ie.input
[wtr-general] Not able to select table data inside an table which is having no unique identity.
Hi, I have table, inside it i have table row, which interm have data [text] as Summary and Detail. Source code from IE is : TABLE class=grid-btable cellSpacing=0 cellPadding=0 width=100% border=0 TBODY id=z_f2_rh TR class=grid id=z_f2_sh style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Grw z.rid=z_f2_4g z.inited=true TD class=gc id=z_f2_th!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_th!cellSPAN id=z_f2_th style=WIDTH: 115pxName:/SPAN/DIV/TD TD class=gc id=z_f2_vh!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_vh!cellINPUT class=text id=z_f2_vh style=WIDTH: 450px maxLength=100 z.type=zul.widget.Txbox/DIV/TD TD class=gc id=z_f2_uh!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_uh!cellSPAN id=z_f2_uh style=WIDTH: 115px(Limit 100 characters)/SPAN/DIV/TD/TR TR class=grid odd id=z_f2_0i style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Grw z.rid=z_f2_4g z.inited=true TD class=gc id=z_f2_1i!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_1i!cellSPAN id=z_f2_1i style=WIDTH: 115pxType:/SPAN/DIV/TD TD class=gc id=z_f2_4i!chdextr style=BORDER-RIGHT: white 0px solid; BORDER-TOP: white 0px solid; BACKGROUND: white; BORDER-LEFT: white 0px solid; BORDER-BOTTOM: white 0px solid z.type=Gcl DIV class=gc cell-inner id=z_f2_4i!cellSPAN class=combobox id=z_f2_4i z.type=zul.cb.Cmbox z.combo=trueINPUT class=comboboxinp readonly id=z_f2_4i!real readOnly value=Summary autocomplete=offSPAN class=rbtnbk id=z_f2_4i!btn style=PADDING- BOTTOM: 2px; PADDING-TOP: 3px; POSITION: relative; TOP: 1pxIMG src=https://vm-bhaveshok2.kazeon.local/reports/zkau/web/zul/img/ combobtn.gif/SPAN DIV class=comboboxpp id=z_f2_4i!pp style=DISPLAY: none tabIndex=-1 TABLE id=z_f2_4i!cave cellSpacing=0 cellPadding=0 TBODY TR class=item id=z_f2_2i z.type=Cmit z.disd=false TD/TD TDSummary/TD/TR TR class=item id=z_f2_3i z.type=Cmit z.disd=false TD/TD TDDetail/TD/TR/TBODY/TABLE/DIV/SPAN/DIV/TD/TR Im looking at last 8 lines. There is no name, class for this table. only there is dynamic id generated. I want to select text Detail: out of this combobox. Can someone help how can i do it. Im using watir webdriver. I tried like : $ie.table(:class, grid-btable).cell(:class = item, :text = reportType).click $ie.input(:value, Summary).select(reportType) $ie.input(:value, Summary).select(reportType) $ie.table(:class, grid-btable).div(:class, comboboxpp).tr(:class, item).td(:text, Detail).click $ie.table(:class, grid-btable).div(:class, comboboxpp).td(:text, 'Detail').click $ie.div(:class, comboboxpp).tr(:class, item).td(:text, Detail).click But all failed with some or other error like not able to find element etc. Bhavesh -- 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] Entering text on a read only textfield.
Hi, Earlier I use Watir unit test frawework and I can enter values in readonly textfield using “.value” method : $ie.text_field(:id, 'targetSSRepsSelected').value=”some value” I upgraded to Watir Webdriver. Now same code fails with error “ReadOnlyException”. Source Code from browser[IE] is : INPUT id=targetSSRepsSelected style=WIDTH: 300px readOnly onchange= name=targetSSRepsSelected When im using watir earlier, I can enter value on this read only textfield, but with webdriver it fails, so what shd I use to enter values now? Any help is appreciated. Thanks Bhavesh -- 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: Webdriver : when i have to grab the id using pattern match it fails for firefox
Hi, Here is the source that get generated in IE: TBODY TR class=item id=z_bp_td z.type=Lit z.disd=false z.rid=z_bp_id z.inited=true TD id=z_bp_ud z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td! sel href=javascript:; z.type=Lcfc/AIMG src=https://vm- bhaveshok2.kazeon.local/admin/images/green_dot.png align=absMiddleSPAN id=z_bp_vd title=bhavtestbhavtest/SPAN/DIV/ TD TD id=z_bp_0e align=left z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_0e!cave /DIV/ TD TD id=z_bp_1e style=WHITE-SPACE: nowrap z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_1e!cave style=WHITE- SPACE: nowrap TABLE id=z_bp_2e style=BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER- LEFT: 0px; BORDER-BOTTOM: 0px cellSpacing=0 cellPadding=0 z.type=zul.box.Box TBODY TR id=z_bp_2e!cave vAlign=top TD id=z_bp_3e!chdextr align=left z.coexist=true TABLE id=z_bp_3e style=WIDTH: 25px cellSpacing=0 cellPadding=0 z.type=zul.box.Box TBODY TR id=z_bp_3e!cave vAlign=top TD id=z_bp_4e!chdextr align=left z.coexist=trueIMG id=z_bp_4e src=https://vm-bhaveshok2.kazeon.local/admin/images/datafs.png; border=0 z.type=zul.widget.Img/TD/TR/TBODY/TABLE/TD TD class=hbox-sp id=z_bp_3e!chdextr2IMG style=WIDTH: 0px; HEIGHT: 0px/TD TD id=z_bp_5e!chdextr align=left z.coexist=trueSPAN id=z_bp_5edatafs (nfs)/SPAN/TD/TR/TBODY/TABLE/DIV/TD TD id=z_bp_6e z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_6e!cavetestkaz/DIV/ TD TD id=z_bp_7e title=ntap34 z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_7e!caventap34/DIV/ TD TD id=z_bp_8e title=/vol/data/bhavnfsdata2(tcp,rw) z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_8e!cave/vol/data/ bhavnfsdata2(tcp,rw)/DIV/TD TD id=z_bp_9e z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_9e!cave0/DIV/TD TD id=z_bp_ae z.type=Lic DIV class=cell-inner overflow-hidden id=z_bp_ae!caveonline/DIV/ TD/TR TR class=item odd id=z_bp_be z.type=Lit z.disd=false z.rid=z_bp_id z.inited=true TD id=z_bp_ce z.type=Lic ## Here im matching bhavtest which is actually parameter #{fsname}. By matching this line, im collecting id div z_bp_ud!cave Then trying to click on that div in UI -- browser.div(:id , $1).click Now this source is generated differentily in Firefox, so this pattern match failed, and im not able to use it. Im using watir from last 2 years but always as a unit test framework. I switched to Webdriver just now as a requirement and therefore i need my previous code to be align to webdriver so that i can execute my script on all browsers. Can you help me out here? Is there any way i can port all my scripts to webdriver? Bhavesh On Dec 9, 3:48 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Dec 9, 2011 at 12:56 AM, Bhavesh bhavesh1_sha...@yahoo.com wrote: so to collect the id's, i go to source of that page and grab the id like : $_ = $ie.html if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/ printIDInfo(FS ID, $1) Why aren't you using watir api? Something like browser.divs(how, what).collect {|div| div.id} If you provide sample html, we could tell more. If it is for speed, there are a few html parsers for ruby: https://www.ruby-toolbox.com/categories/html_parsing Ž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: Webdriver : when i have to grab the id using pattern match it fails for firefox
Ok, Here is the line that im matching from source from IE : DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td! sel href=javascript:; z.type=Lcfc/AIMG src=https://vm- bhaveshok2.kazeon.local/admin/images/ green_dot.pngalign=absMiddleSPAN id=z_bp_vd title=bhavtestbhavtest/SPAN/DIV/TD My subroutine code is : def clickFSlink(fsname=) printClickInfo(clickfslink, fsname) $_ = $ie.html if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/ printIDInfo(FS ID, $1) begin $ie.div(:id , $1).click rescue = e rescueHandle(e) end sleep($deepSleep) else puts FAILED! Could not find DatafsID return false end end My script is : require 'watir-webdriver' require 'Lib/KazeonCommon/BasicMethodLibrary' class test1 Test::Unit::TestCase def test_ puts ** printTestingReportHeader(I18N Regression Testing, WEB_ADMIN) puts ** end def test_0001 returnValue = true $ie.goto($adminLink) sleep(10) #skipSecurity(Continue to this website) kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon) sleep(5) clickFSlink(bhavtest) ## Here it fails for firefox. end end This works well in Ie, but when i use the same code by changing browser to firefox, it fails. Bhavesh On Dec 9, 10:42 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: Here im matching bhavtest which is actually parameter #{fsname}. By matching this line, im collecting id div z_bp_ud!cave Then trying to click on that div in UI -- browser.div(:id , $1).click I am completely confused. Could you please send only the tag that interests you and your watir code? Željko -- 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: Webdriver : when i have to grab the id using pattern match it fails for firefox
Hi, I got the solution, i written code like this : $ie.div(:class = cell-inner overflow-hidden, :text = bhavtest).click And it works. But there are some cases where only thing we can get is id which is dynamic like an text filed: INPUT class=inputbg id=z_s8_td style=WIDTH: 150px; HEIGHT: 15px z.type=zul.widget.Txbox. Here it is only dynmaic id and not even any text. I see two problems : 1. How can i enter text in this text field when i just have dynamic id usng webdriver? 2. This particular html is present many times in a page, so to get the ID, which is dynamic, it is very difficult. Here i cannot use class as it is same in many text fields. If i club index here then it is alos risky as many text fileds gets added/removed as applicaiton developed. So is there any way i can identify this textbox? Right now i pattern match it with few lines above this code, i mean right now page is like Name: Text field, passwrod:Text filed So i pattern match with Name: then till this textfield. Grabs the id and then enter text in it, like : if /TD id=.*Name:.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.* \n.*\n.*\n.*\n.*\n.*\n.*INPUT class=inputbg id=(\S*) style=.*Txbox/ But in webdriver this pattern match is not usable, then i have a problem, can you suggest any solution to this? Bhavesh On Dec 9, 2:21 pm, Chuck van der Linden sqa...@gmail.com wrote: Lets backup a minute because I think you are going about this in a very convoluted way based on something you figured out that works, but may in fact be a bit of a kludge. The div being clicked on contains a link, an image, and a span with text. First question, when interfacing with the site, how does a HUMAN know what to click on? Is it the image being displayed? The text? the combination of the two? or either? If it's the text, then why not just select the div that way b.div(:text = 'bhavtest').click If it's the Image, then why not find that using a regex for the src of the image, and then use .parent to locate the containing div and click it? b.img(:src = /your_regex_here/).parent.click if it needs to be a parameter then replace the constants above with a variable, or a regex object created from a variable If it's the combination of the two things (image and text) then you might have to be a bit trickier but it should still be possible and a bit more straightforward than what you were doing. Using ID's to identify something is great where that is something you can predict, but otherwise, if you are using some other means to find the thing you want, doing that in order to get the ID and then using the ID to interact with the element is really just taking the long way around. Instead (unless it's not supported) use the thing you know to identify and interact with the element. On Dec 9, 11:02 am, Bhavesh bhavesh1_sha...@yahoo.com wrote: Ok, Here is the line that im matching from source from IE : DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td! sel href=javascript:; z.type=Lcfc/AIMG src=https://vm- bhaveshok2.kazeon.local/admin/images/ green_dot.pngalign=absMiddleSPAN id=z_bp_vd title=bhavtestbhavtest/SPAN/DIV/TD My subroutine code is : def clickFSlink(fsname=) printClickInfo(clickfslink, fsname) $_ = $ie.html if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/ printIDInfo(FS ID, $1) begin $ie.div(:id , $1).click rescue = e rescueHandle(e) end sleep($deepSleep) else puts FAILED! Could not find DatafsID return false end end My script is : require 'watir-webdriver' require 'Lib/KazeonCommon/BasicMethodLibrary' class test1 Test::Unit::TestCase def test_ puts ** printTestingReportHeader(I18N Regression Testing, WEB_ADMIN) puts ** end def test_0001 returnValue = true $ie.goto($adminLink) sleep(10) #skipSecurity(Continue to this website) kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon) sleep(5) clickFSlink(bhavtest) ## Here it fails for firefox. end end This works well in Ie, but when i use the same code by changing browser to firefox, it fails. Bhavesh On Dec 9, 10:42 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: Here im matching bhavtest which is actually parameter #{fsname}. By matching this line, im collecting id div z_bp_ud!cave Then trying to click on that div in UI -- browser.div(:id , $1).click I am completely confused. Could you please send only the tag that interests you and your watir code
[wtr-general] Re: Webdriver : when i have to grab the id using pattern match it fails for firefox
Well i got it working with index : $ie.text_field(:class = inputbg, :index = 0).set bhavesh sleep(5) But still im finding ways. Bhavesh On Dec 9, 3:17 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi, I got the solution, i written code like this : $ie.div(:class = cell-inner overflow-hidden, :text = bhavtest).click And it works. But there are some cases where only thing we can get is id which is dynamic like an text filed: INPUT class=inputbg id=z_s8_td style=WIDTH: 150px; HEIGHT: 15px z.type=zul.widget.Txbox. Here it is only dynmaic id and not even any text. I see two problems : 1. How can i enter text in this text field when i just have dynamic id usng webdriver? 2. This particular html is present many times in a page, so to get the ID, which is dynamic, it is very difficult. Here i cannot use class as it is same in many text fields. If i club index here then it is alos risky as many text fileds gets added/removed as applicaiton developed. So is there any way i can identify this textbox? Right now i pattern match it with few lines above this code, i mean right now page is like Name: Text field, passwrod:Text filed So i pattern match with Name: then till this textfield. Grabs the id and then enter text in it, like : if /TD id=.*Name:.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.* \n.*\n.*\n.*\n.*\n.*\n.*INPUT class=inputbg id=(\S*) style=.*Txbox/ But in webdriver this pattern match is not usable, then i have a problem, can you suggest any solution to this? Bhavesh On Dec 9, 2:21 pm, Chuck van der Linden sqa...@gmail.com wrote: Lets backup a minute because I think you are going about this in a very convoluted way based on something you figured out that works, but may in fact be a bit of a kludge. The div being clicked on contains a link, an image, and a span with text. First question, when interfacing with the site, how does a HUMAN know what to click on? Is it the image being displayed? The text? the combination of the two? or either? If it's the text, then why not just select the div that way b.div(:text = 'bhavtest').click If it's the Image, then why not find that using a regex for the src of the image, and then use .parent to locate the containing div and click it? b.img(:src = /your_regex_here/).parent.click if it needs to be a parameter then replace the constants above with a variable, or a regex object created from a variable If it's the combination of the two things (image and text) then you might have to be a bit trickier but it should still be possible and a bit more straightforward than what you were doing. Using ID's to identify something is great where that is something you can predict, but otherwise, if you are using some other means to find the thing you want, doing that in order to get the ID and then using the ID to interact with the element is really just taking the long way around. Instead (unless it's not supported) use the thing you know to identify and interact with the element. On Dec 9, 11:02 am, Bhavesh bhavesh1_sha...@yahoo.com wrote: Ok, Here is the line that im matching from source from IE : DIV class=cell-inner overflow-hidden id=z_bp_ud!caveA id=z_bp_td! sel href=javascript:; z.type=Lcfc/AIMG src=https://vm- bhaveshok2.kazeon.local/admin/images/ green_dot.pngalign=absMiddleSPAN id=z_bp_vd title=bhavtestbhavtest/SPAN/DIV/TD My subroutine code is : def clickFSlink(fsname=) printClickInfo(clickfslink, fsname) $_ = $ie.html if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/ printIDInfo(FS ID, $1) begin $ie.div(:id , $1).click rescue = e rescueHandle(e) end sleep($deepSleep) else puts FAILED! Could not find DatafsID return false end end My script is : require 'watir-webdriver' require 'Lib/KazeonCommon/BasicMethodLibrary' class test1 Test::Unit::TestCase def test_ puts ** printTestingReportHeader(I18N Regression Testing, WEB_ADMIN) puts ** end def test_0001 returnValue = true $ie.goto($adminLink) sleep(10) #skipSecurity(Continue to this website) kazeonLegalLogin(WEB_ADMIN, Local, admin, kazeon) sleep(5) clickFSlink(bhavtest) ## Here it fails for firefox. end end This works well in Ie, but when i use the same code by changing browser to firefox, it fails. Bhavesh On Dec 9, 10:42 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Dec 9, 2011 at 7:06 PM, Bhavesh bhavesh1_sha...@yahoo.com
[wtr-general] Webdriver : when i have to grab the id using pattern match it fails for firefox
Hi, I have to grab id's for some of the fileds by pattern matching, because these are dynamic. so to collect the id's, i go to source of that page and grab the id like : $_ = $ie.html if /DIV class.*cell-inner.*id=(\S*).*dot.png.*#{fsname}/ printIDInfo(FS ID, $1) This is what i matched from the source generated when IE is opened. Now im using WEbdriver to drive the watir script. If i use this routine and execute the script on IE, it works well. but if i chnage my driver to firefox, then it fails. It is generous that it will fail, because the source generated in firefox is different then IE, what i pattern matched. So how cna i overcome this problem for webdriver? Such that i can grab the id's using patern match and thne execute the script in IE and firefox both. Or even in Chrome. Can someone help? Bhavesh -- 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: sending i18n data to remote computer using watir scripts.
Di Anyone knows about it? On Jun 29, 3:56 pm, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi, I have routines to send commands to remote computer. def issueCommandInKazBox5(okMachine=, command=, matchLog=, user=admin, passwd=kazeon) puts issueCommandInKazMachine=#{okMachine} puts issueCommandInKazcommand=#{command} puts issueCommandInKazstatus=#{matchLog} puts issueCommandInKazuser=#{user} puts issueCommandInKazpasswd=#{passwd} Net::SSH.start(okMachine, user, :password = kazeon, :auth_methods = [password]) do |session| session.open_channel do |channel| channel.request_pty do |ch, success| raise Error requesting pty unless success ch.send_channel_request(shell) do |ch, success| raise Error opening shell unless success end end channel.on_data do |ch, data| STDOUT.print data end channel.on_extended_data do |ch, type, data| STDOUT.print Error: #{data}\n end channel.send_data #{command}\n.force_encoding('utf-8') channel.send_data exit\n session.loop end end end I fire commands like this to get the command fire on remote machine : issueCommandInKazBox($node1, add user bhavesh role admin, ) It works properly for english data. But when i have utf8 data, it throws error : issueCommandInKazBox($node1, add user âêžýáíúöóá¿ role admin, ) Error is : 1) Error: test_0001(TC_I18N): OpenSSL::Cipher::CipherError: data not multiple of block length C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/stat e.rb:85:in `final' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/stat e.rb:85:in `final_cipher' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/pack et_stream.rb:142:in `enqueue_packet' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/sess ion.rb:223:in `enqueue_message' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:368:in `send_message' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:493:in `enqueue_pending_output' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:312:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `block in preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `each' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:197:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `block in loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/Lib/KazeonCommon/ BasicMethodLibrar y.rb:2523:in `block (2 levels) in issueCommandInKazBox5' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:513:in `call' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:513:in `do_open_confirmation' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:535:in `channel_open_confirmation' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:456:in `dispatch_incoming_packets' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:213:in `preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:197:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `block in loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:110:in `close' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh.rb: 191:in `sta rt' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/Lib/KazeonCommon/ BasicMethodLibrar y.rb:2500:in `issueCommandInKazBox5' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ I18N_Regression.rb :71:in `test_0001' I already have encoding set to utf8 in my script. what do i have to change to get it working? and where? Bhavesh -- 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
[wtr-general] sending i18n data to remote computer using watir scripts.
Hi, I have routines to send commands to remote computer. def issueCommandInKazBox5(okMachine=, command=, matchLog=, user=admin, passwd=kazeon) puts issueCommandInKazMachine=#{okMachine} puts issueCommandInKazcommand=#{command} puts issueCommandInKazstatus=#{matchLog} puts issueCommandInKazuser=#{user} puts issueCommandInKazpasswd=#{passwd} Net::SSH.start(okMachine, user, :password = kazeon, :auth_methods = [password]) do |session| session.open_channel do |channel| channel.request_pty do |ch, success| raise Error requesting pty unless success ch.send_channel_request(shell) do |ch, success| raise Error opening shell unless success end end channel.on_data do |ch, data| STDOUT.print data end channel.on_extended_data do |ch, type, data| STDOUT.print Error: #{data}\n end channel.send_data #{command}\n.force_encoding('utf-8') channel.send_data exit\n session.loop end end end I fire commands like this to get the command fire on remote machine : issueCommandInKazBox($node1, add user bhavesh role admin, ) It works properly for english data. But when i have utf8 data, it throws error : issueCommandInKazBox($node1, add user âêžýáíúöóá¿ role admin, ) Error is : 1) Error: test_0001(TC_I18N): OpenSSL::Cipher::CipherError: data not multiple of block length C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/stat e.rb:85:in `final' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/stat e.rb:85:in `final_cipher' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/pack et_stream.rb:142:in `enqueue_packet' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ transport/sess ion.rb:223:in `enqueue_message' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:368:in `send_message' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:493:in `enqueue_pending_output' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:312:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `block in preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `each' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:214:in `preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:197:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `block in loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/Lib/KazeonCommon/ BasicMethodLibrar y.rb:2523:in `block (2 levels) in issueCommandInKazBox5' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:513:in `call' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/cha nnel.rb:513:in `do_open_confirmation' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:535:in `channel_open_confirmation' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:456:in `dispatch_incoming_packets' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:213:in `preprocess' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:197:in `process' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `block in loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:161:in `loop' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ connection/ses sion.rb:110:in `close' C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh.rb: 191:in `sta rt' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/Lib/KazeonCommon/ BasicMethodLibrar y.rb:2500:in `issueCommandInKazBox5' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ I18N_Regression.rb :71:in `test_0001' I already have encoding set to utf8 in my script. what do i have to change to get it working? and where? Bhavesh -- 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: Closing and opening IE session in watir.
Hi, I tried to log a bug but then it default to Bamboo development if i use this link : http://jira.openqa.org/browse/WTR I need to log this to WATIR development, so how can i change the component to watir devlopment. Bhavesh On Jun 8, 12:30 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jun 8, 2011 at 7:38 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: If i replace the piece of code for ie.close of version 1.6.7 in 1.8.1 file, the same routine starts working fine. I suggest that you create a Jira ticket: http://jira.openqa.org/browse/WTR Željko -- 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: Closing and opening IE session in watir.
Error coming out as : TestCaseNum: I18N_0001 Description: Add AD Authentication from Webadmin, for FIGS. E Finished in 0.468750 seconds. 1) Error: test_0001(TC_I18N): NoMethodError: unknown property or method: `name' HRESULT error code:0x800706ba The RPC server is unavailable. C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- class.rb:319:in `method_missing' C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- class.rb:319:in `exists?' C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- class.rb:406:in `close' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ I18N_Regression.rb :47:in `setupnew' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ I18N_Regression.rb :102:in `test_0001' On Jun 8, 12:17 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jun 8, 2011 at 12:51 AM, Bhavesh bhavesh1_sha...@yahoo.com wrote: It closes the IE if it is open but then not opening the new IE it just came out of script throwing error. And the error message is? Željko -- watir.com - community manager watir.com/book - author watirpodcast.com - host viaqa.mobi conference on software testing - organizer -- 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: Closing and opening IE session in watir.
Hi Željko, I got the problem but not the solution. In watir 1.6.7 which i use previously, code for ie.close is like this : #C:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.7\lib\watir # Closes the Browser def close return unless exists? @closing = true @ie.stop wait rescue nil chwnd = @ie.hwnd.to_i @ie.quit while Win32API.new(user32,IsWindow, 'L', 'L').Call(chwnd) == 1 sleep 0.3 end end In watir 1.8.1 which i use now, code for ie.close is like this : C:\Ruby192\lib\ruby\gems\1.9.1\gems\watir-1.8.1\lib\watir # Closes the Browser def close return unless exists? @ie.stop wait rescue nil chwnd = @ie.hwnd.to_i @ie.quit t = Time.now while exists? # just in case to avoid possible endless loop if failing to close some # window or tab break if Time.now - t 10 sleep 0.3 end end There is an change in code in 1.8.1. If i replace the piece of code for ie.close of version 1.6.7 in 1.8.1 file, the same routine starts working fine. So what needs to be done now to have this working with 1.8.1 code? Bhavesh On Jun 8, 10:21 am, Bhavesh bhavesh1_sha...@yahoo.com wrote: Error coming out as : TestCaseNum: I18N_0001 Description: Add AD Authentication from Webadmin, for FIGS. E Finished in 0.468750 seconds. 1) Error: test_0001(TC_I18N): NoMethodError: unknown property or method: `name' HRESULT error code:0x800706ba The RPC server is unavailable. C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- class.rb:319:in `method_missing' C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- class.rb:319:in `exists?' C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.8.1/lib/watir/ie- class.rb:406:in `close' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ I18N_Regression.rb :47:in `setupnew' C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/KazModules/I18N/ I18N_Regression.rb :102:in `test_0001' On Jun 8, 12:17 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jun 8, 2011 at 12:51 AM, Bhavesh bhavesh1_sha...@yahoo.com wrote: It closes the IE if it is open but then not opening the new IE it just came out of script throwing error. And the error message is? Željko -- watir.com - community manager watir.com/book - author watirpodcast.com - host viaqa.mobi conference on software testing - organizer -- 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] netssh and ruby 1.9.2
Hi Ealrier i have Ruby 1.8.* and my code to send command to linux box is working fine. But now i upgraded to Ruby 1.9.2. So i upgraded needle, setsftp and netssh too. Now same piece of code is not working, it throws error for on_success. def issueCommandInKazBox(okMachine=, command=, matchLog=, user=admin, passwd=kazeon) puts issueCommandInKazMachine=#{okMachine} puts issueCommandInKazcommand=#{command} puts issueCommandInKazstatus=#{matchLog} puts issueCommandInKazuser=#{user} puts issueCommandInKazpasswd=#{passwd} tempString = Net::SSH.start(okMachine, user, :password = passwd, :paranoid = false ) do |session| #Net::SSH.start(okMachine, user, passwd) do |session| session.open_channel do |channel| channel.on_success do puts shell was started successfully! puts Adding command - #{command}... channel.send_data #{command}\n channel.send_data exit\n # tell the shell to exit end channel.on_failure do puts shell could not be started! end channel.on_data do |ch,data| puts recieved the following from shell puts #{data} tempString = tempString + \n + data end channel.on_close do puts shell terminated end channel.send_request shell, nil, true end session.loop end # Can someone let me know what needs to be change to have this working. Any help is appreciated, im stuck because of this. Bhavesh -- 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: netssh and ruby 1.9.2
Hi, Im doing automation on Watir. Watir is installed over Ruby. I upgraded Ruby as well as Watir to new version. Now when i execute my watir script, this routine is failing. Bhavesh On Jun 8, 4:03 pm, Charley Baker charley.ba...@gmail.com wrote: I'll say what other people will. This is a watir user group, you'd likely find more help on the Ruby forum:http://www.ruby-forum.com/forum/ruby either that or mailing lists for that project. Cheers, Charley On Wed, Jun 8, 2011 at 4:59 PM, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi Ealrier i have Ruby 1.8.* and my code to send command to linux box is working fine. But now i upgraded to Ruby 1.9.2. So i upgraded needle, setsftp and netssh too. Now same piece of code is not working, it throws error for on_success. def issueCommandInKazBox(okMachine=, command=, matchLog=, user=admin, passwd=kazeon) puts issueCommandInKazMachine=#{okMachine} puts issueCommandInKazcommand=#{command} puts issueCommandInKazstatus=#{matchLog} puts issueCommandInKazuser=#{user} puts issueCommandInKazpasswd=#{passwd} tempString = Net::SSH.start(okMachine, user, :password = passwd, :paranoid = false ) do |session| #Net::SSH.start(okMachine, user, passwd) do |session| session.open_channel do |channel| channel.on_success do puts shell was started successfully! puts Adding command - #{command}... channel.send_data #{command}\n channel.send_data exit\n # tell the shell to exit end channel.on_failure do puts shell could not be started! end channel.on_data do |ch,data| puts recieved the following from shell puts #{data} tempString = tempString + \n + data end channel.on_close do puts shell terminated end channel.send_request shell, nil, true end session.loop end # Can someone let me know what needs to be change to have this working. Any help is appreciated, im stuck because of this. Bhavesh -- Before posting, please readhttp://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 -- 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] Closing and opening IE session in watir.
Hi, I have to close IE and open new IE again in every testcase. I written an routine like this : def setupnew(current_component=) $ie.close if $ie sleep(10) $ie = Watir::IE.new() sleep(10) case current_component when WEB_ADMIN $ie.goto($adminLink) when WEB_REPORT $ie.goto($reportLink) when WEB_SEARCH $ie.goto($searchLink) else #puts Setup case does not match end end This works well in Ruby 1.8 Recently i upgrade to Ruby 1.9.2 and this routine start failing. It closes the IE if it is open but then not opening the new IE it just came out of script throwing error. Any suggestion how can i use it in 1.9.2? Bhavesh -- 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] not able to send commands to linux boxes when upgraded to Ruby 1.9.2
Hi I have a setup where i have to send command to linux boxes. I installed Ruby 1.9.2 and latest version of needle, net-sftp and net- ssh. routine is like -- def issueCommandInOKBox(okMachine=, command=, expectedLog=, expectedResult=PASS, user=k1, passwd=1) puts issueCommandInOKBox: okMachine=#{okMachine} puts issueCommandInOKBox: command=#{command} puts issueCommandInOKBox: expectedLog=#{expectedLog} puts issueCommandInOKBox: expectedResult=#{expectedResult} puts issueCommandInOKBox: user=#{user} puts issueCommandInOKBox: passwd=#{passwd} returnValue = true Net::SSH.start( okMachine, user, passwd, :paranoid = false) do | session| shell = session.shell.sync puts Should print home directory: out = shell.pwd p out.stdout puts Should print response logs after executing commmand: out = shell.send_command command p out.stdout $outputofissueCommandInOKBox = out.stdout #puts --- #{out.stdout} $_ = out.stdout This is working fine when i have Ruby 1.8 and watir 1.6.5 with needle 1.1.0 and other netssh and netsftp. But now when i upgraded, this fails. I can do ssh using putty to these boxes, but through script it is fialing. Any help how i can have this working? Bhavesh -- 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] Need help on .value method in watir
Hi, Im trying to insert text using .value method in watir script. I used like this. $ie.text_field(:id, $1).value=(ChineseData) When script executes, it shows this data in that text filed, but actually it is not inserted in the text filed. When i click submit, it throws error that filed is empty. What is the cause? how can i resolve this? I cannot use .set method as i have utf8 or special characters. Can someone help me out with this. Your help is appreciated. Thanks Bhavesh -- 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] I18n support in watir/ruby.
Hi, I have some chinese, french characters in the description filed of an application. I have to match that through watir/ruby scripts. But in CLI, it appears as juncked and thus pattern match failed. Do anyone know how to match I18n characters in watir? Do i need to install any addon for this to work? Any help would be highly appreciated. Thanks Bhavesh -- 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] How to suppress warning thrown by Watir.
Hi, I have to collect text from al the frames into one variable and then have to pattern match it. But problem is like some frames exists sometime and sometime not. So i rescued it, but still i see warning like -- failed Unable to locate a frame with id flatViewFrame PASSED! Page contains text - Version 4.4.0 So how can i suppress these warning failed Unable to locate a frame with id flatViewFrame I tried using like this -- exists?text1 += $ie.frame(:id, 'flatViewFrame').text But no effect, it is still showing me warnings. so is there any other way to suppress warnings. -- 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
[wtr-general] Re: how watir reads page source? how ie.html works?
Hi John, thanks a lot, it worked. thanks again, bhavesh On Feb 19, 7:39 pm, JArkelen johnvanarke...@gmail.com wrote: Connect to the frame, so instead of: ie.link(:id, 'some_link').click use: ie.frame(:id, 'tableViewFrame').link(:id, 'some_link').click Cheers, John On Feb 19, 7:14 am, Bhavesh bhavesh1_sha...@yahoo.com wrote: Hi, Currently i am using ie.html and ie.text to get the page source and then using this i can actaully clicking on the objects etc. However there are some changes done recently of EXTJS and now im not able to see page source. It is now like frame wise. When talked with developer, it is replied like now page source is frame wise. Earlier i use this command to get page source -- “javascript:'xmp' + window.document.body.outerHTML+ '/xmp'” But now it is -- “javascript:'xmp'%20+ %20document.getElementById(flatViewFrame).contentWindow.document.body.out erHTML +%20'/xmp'” “javascript:'xmp'%20+ %20document.getElementById(tableViewFrame).contentWindow.document.body.ou terHTML +%20'/xmp'” So i dont know what Watir uses bydefault or internally? I there any way i can change it in Watir so that i can get the source. If i fire my script it is failing. in my script i verifying text appearing on the page, and uisng ie.html for it, but it is failing as it is not able to grap the complete page source. Bhavesh- 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
[wtr-general] How can i click CTRL key + Link in Watir
Hi , I have to click CTRL key + link using watir. Is anybody know how to do it? Actually i can tmodify any setting in IE, os i have to press CTRL key manually and then link to open an link. But for automation, i have to do it using WATIR Any help is appreciated. Bhavesh --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] how to select rows under grid for EXTJS code using watir.
Hi, I have to select the row under Grid which is an extjs code. When we have a grid, and want to select a row in the grid, for some reason we cannot select it. We have sent click events and it appears that we're getting the right row (watir highlights the row in the browser), but our app code doesnt get the event from ext-js. Can some one help me how can i click/select this row, so that i can go ahead. Any help is appriciated. Bhavesh --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---