[wtr-general] Re: How to access the another Ruby script value inside my Main Ruby Script
You need to define your own Classes and Class variables (and methods) for that to work. This is more a question of how to write effective Ruby code than it is a question of how to write your Watir scripts. -- 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: Differences between watir and watir-webdriver
What are you using attach for, since you consider it a deal breaker? Hi Jari, I am trying to rebuild my current test framework using Watir and other ruby components. Currently, we use HP's BPT framework where reusable business components (sort of like functions but with additional stuff). With this framework, each piece is independent without any care about what comes before or after. My thought is to use the attach method to rejoin to the browser under test when the new component starts. I have not gotten so far enough on my framework rebuild to know if this function will be absolutely necessary. Also, the attach method would be great when using the IRB to troubleshoot bits of code. A lot easier than creating a new browser and navigating to the page every time you need it. Thanks...Bob -- 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: Differences between watir and watir-webdriver
window switching API -- I know nothing about it. Looks like a good opportunity to learn something. Thanks...Bob -- 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: Find the pages which throw javascript error in IE
thanks a lot... Firefox will also be well enough... please send.. Regards, Roy On Jan 28, 4:23 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Fri, Jan 27, 2012 at 7:38 AM, Roy snigdho@gmail.com wrote: I have a list of URLs. I need to find out the pages which throws javascript error when opened in IE, irrespective of the exact error. I have a solution for that, but for Firefox only. I will blog about it soon. If Firefox is good enough for you, let me know, I can send you what I have so far. Ž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] POPUP HANDLING IN WATIR
Hi All, I have been using this above module to handle popup in my WATIR tests. what I have seen is it works fine when I call a click_no_wait on my submit button. When I try to use fire_event method it doesn't works as expected and the execution halts till i manually click the OK button. Please help I am adding a section of the code I m using below :Doesn't work untill I click the OK button on the dialog box manually --- $browser.text_field(:id, 'MIR-DV-EFF-DT').set('13-10-2011') #$browser.text_field(:id, 'MIR-DV-EFF-DT').fire_event(onBlur) popupMsg = clickprompt(OK,,$browser) puts popupMsg :Works fine and give me a console output Invalid Date format '13-10-2011' --- $browser.text_field(:id, 'MIR-DV-EFF-DT').set('13-10-2011') $browser.button(:id, 'OKButton').click_no_wait popupMsg = clickprompt(OK,,$browser) puts popupMsg -- 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 HandlePopUp.rb Description: Binary data
[wtr-general] Re: Find the pages which throw javascript error in IE
Hey Željko.. thanks a lot... Firefox will be good enough as well... please send as I got stuck badly.. Regards, Abhrajit On Jan 28, 4:23 am, Željko Filipin zeljko.fili...@gmail.com wrote: On Fri, Jan 27, 2012 at 7:38 AM, Roy snigdho@gmail.com wrote: I have a list of URLs. I need to find out the pages which throws javascript error when opened in IE, irrespective of the exact error. I have a solution for that, but for Firefox only. I will blog about it soon. If Firefox is good enough for you, let me know, I can send you what I have so far. Ž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
Re: [wtr-general] Re: Handling a MAC Pro book File Upload window.
Hi Chuck, Thank you for your response. I gave you suggestion a try and it didn't workout. I did the install of the gem install rautomation this is my part of my code require 'rautomation' @browser.div(:class,'add-video').object.click #this 'object' is the SWFUpload flash 'search' button that launches the SFWUpload 'select file(s) to upload...' window @window = RAutomation::Window.new :title = /Select file/ @window.text_field(:class,video-upload file).set video_path @window.button(:class,swfupload).click The error message /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- rautomation (LoadError) from /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /Users/josephfleck/Sites/within3/qa_automation/common/helper_methods.rb:1158:in `share_video' from add_multiple_share_members_types.rb:181 from /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/fastercsv-1.5.4/lib/faster_csv.rb:696:in `each' from /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/fastercsv-1.5.4/lib/faster_csv.rb:696:in `each' from add_multiple_share_members_types.rb:82 I am not sure were to go from here. Thank you, Joe On Wed, Nov 23, 2011 at 6:22 PM, Chuck van der Linden sqa...@gmail.com wrote: It looks like you are using SWFUpload a flash based utility that allows for some special upload capabilities (set the file extensions, multiple files, etc) This means it's using non standard upload controls. You MIGHT be able to work around it by overriding the hidden values, but the other option would be to automate at the UI level. I can't say what would work best for this on a Mac, but on the Windows side, the RAutomation gem makes pretty short work of that upload window. require 'rautomation' $browser.div(:id, 'theme_uploader').object.click #this 'object' is the SWFUpload flash 'search' button that launches the SFWUpload 'select file(s) to upload...' window window = RAutomation::Window.new :title = /Select file/ window.text_field(:class = Edit).set('C:\sandbox\QAAuto\Image \Image\spicy_728x90.gif') window.button(:value = Open).click On Oct 18, 7:22 am, Joe Fleck joeflec...@gmail.com wrote: Hi Jari, Here is the HTML code. Will this help? legendVideo Attachment Details/legend div id=add-video class=add-video input id=video_attachment_video_file_name type=hidden name= video_attachment[video_file_name] label for=video_attachment_video_file_name input id=video_filename class=video-upload file type=text disabled= disabled object id=SWFUpload_0 class=swfupload width=87 height=27 data= I am not sure what you mean by [The only way to deal with these types of uploads is to make the file field visible, usually by modifying its style through Browser#execute_script.]. Can you give me an example? Thank you, Joe On Tue, Oct 18, 2011 at 10:35 AM, Jari Bakken jari.bak...@gmail.com wrote: Some file upload solutions lets the user click a link, which then creates a hidden file field and opens the upload dialog. The only way to deal with these types of uploads is to make the file field visible, usually by modifying its style through Browser#execute_script. This may be what you're seeing, though unless you show us a page that will reproduce the problem, it's a wild guess. Jari On Tue, Oct 18, 2011 at 4:19 PM, Joe Fleck joeflec...@gmail.com wrote: Hi, Thank you all for helping. I really appreciate it. I believe the file path is correct now because the error message I am now getting has changed. Code: #Attach file @browser.file_field(:id, the_file).set(/Users/josephfleck/Documents/DownloadDocs/DataFile.xls) It doesn't object name i am giving it. Do I need to use something else like the actual object name of the text field? /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:248:in `assert_exists': unable to locate element, using {:type=file, :tag_name=input, :id=the_file} (Watir::Exception::UnknownObjectException) from /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/file_field.rb:23:in `value=' from /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/file_field.rb:14:in `set' from ./common/helper_methods.rb:182:in `share_documents' from /Users/josephfleck/Sites/within3/qa_automation/discussion/add_multiple_discussion.rb:159 from /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:696:in `each'