So, my mac is set up with the files on it in this location [user/josephfleck/Sites/with/qa_automation/common]. Would I use relative path because on the Windows VM the path is not the same.
On Fri, Jan 13, 2012 at 5:16 PM, Chuck van der Linden <[email protected]> wrote: > I would only make a gem if you feel it would be of benefit to others > etc. > > RUBYLIB is a name for an environment variable that tells ruby what > directory to search when looking to find something you have a require > statement for in the script. If you have your own utility library > that you are putting somewhere on the system, you just need to create > that environment variable on the system, and point it to that > directory and ruby should then find your stuff when you require it in > the script. > > On Jan 12, 5:26 pm, Joe Fleck <[email protected]> wrote: >> Hi Chuck, >> >> The file and scripts are stored on github for our team to use. I have >> pulled(clone) then down on to the windows VM. If I make changes to >> that class and files I need to push them back up to github for the qa >> team. >> >> I still about 3 to 4 months new to Watir and Ruby so I haven't done a >> RUBYLIB. I wonder if creating a gem with these would be a better >> alternative. >> >> What would I need to do for both? >> >> On Thu, Jan 12, 2012 at 5:31 PM, Chuck van der Linden <[email protected]> >> wrote: >> >> >> >> >> >> >> >> > Meh just realised you gave me what I needed,, Ignore the other >> > response. >> >> > Where is common/helpermethods installed? is that your own utility >> > library (and not a gem) >> >> > You may need to establish a 'RUBYLIB' environment variable in the >> > windows box (let me know if you don't know how to do that) that >> > points to the directory where you have that stuff. I use c:\lib for >> > that kind of thing, but hey whatever works for you. avoid spaces >> > unless you want to have to put stuff in quotes. Remember its windows/ >> > dos and use a backslash and not slash (grin) >> >> > On Jan 12, 7:54 am, Joe Fl <[email protected]> wrote: >> >> Sorry I setup a windows vm and the error above happens when I try and >> >> run the script. >> >> >> On Jan 12, 10:06 am, Joe Fl <[email protected]> wrote: >> >> >> > Hi Chuck, >> >> >> > I have set myself up with VMware Fusion and brought down my scripts >> >> > and folders from github but how do I handle this? >> >> >> > C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in >> >> > `require': cannot load such file -- common/helper_methods (LoadError) >> >> > from >> >> > C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb: >> >> > 36:in `require' >> >> > from add_multiple_share_members_types.rb:7:in `<main>' >> >> >> > >Exit code: 1 >> >> >> > Do I need to place the full path in the script? I use a csv file for >> >> > input data in the app too. >> >> >> > Code: >> >> >> > # the rubygems >> >> > require "rubygems" >> >> >> > # the Watir webdriver controller >> >> > require "watir-webdriver" >> >> >> > require 'common/helper_methods' >> >> >> > #require 'discussion/generate_sharing_data' >> >> >> > require 'faster_csv' >> >> >> > helper = HelperMethods.new($browser) >> >> >> > #Call method to delete text from file >> >> > name_of_file = 'multi_add_discussion_headers.txt' >> >> > helper.delete_file_text(name_of_file) >> >> >> > #Call method to delete text from file >> >> > name_of_file = 'multi_add_discussion_reusable_data.txt' >> >> > helper.delete_file_text(name_of_file) >> >> >> > #Setting variable name with script name >> >> > script_name = File.basename(__FILE__,".rb") >> >> >> > Thank you, >> >> > Joe >> >> >> > On Jan 6, 7:51 pm, Chuck van der Linden <[email protected]> wrote: >> >> >> > > well on a PC you can do that with either AutoIt, or Rautomation. Not >> >> > > so sure with the mac (although someone else may be able to help) >> >> >> > > I'm learning to be a mac user after years with windows systems, but >> >> > > when it comes to running watir I just do it through VM's hosted on the >> >> > > mac for a number of reasons, so while I technically run watir or >> >> > > watir- >> >> > > webdriver on a mac, I'm not actually running it on OSX >> >> >> > > On Jan 6, 10:57 am, Joe Fleck <[email protected]> wrote: >> >> >> > > > Chuck, >> >> >> > > > Thank you this was very helpful. I do have VMWare fusion so I will >> >> > > > begin using it to run my scripts. I usually have this problem when >> >> > > > developing my scripts. I development them in Netbeams (6.0) and run >> >> > > > them from there. When you wrote this 'You >> >> > > > may need to set focus to the browser window first.' did you mean >> >> > > > manually or is there a method that will do this? >> >> >> > > > Thank you, >> >> > > > Joe >> >> >> > > > On Fri, Jan 6, 2012 at 12:45 PM, Chuck van der Linden >> >> > > > <[email protected]> wrote: >> >> >> > > > > On Jan 6, 6:51 am, Joe Fleck <[email protected]> wrote: >> >> > > > >> Hi, >> >> >> > > > >> I have found it does work but won't if the browser is not in my >> >> > > > >> admitted focus. I am using a MAC BookPro. Has anyone else >> >> > > > >> experienced this? >> >> >> > > > >> Thank you, >> >> > > > >> Joe >> >> >> > > > > Most 'send keys' operations emulate typing at the keyboard, and >> >> > > > > are >> >> > > > > generally done at the OS level. As a result the keystrokes tend >> >> > > > > to go >> >> > > > > to whatever has focus in the UI of the system you are testing on. >> >> > > > > You >> >> > > > > may need to set focus to the browser window first. That can mean >> >> > > > > it's >> >> > > > > pretty difficult to do anything else on the system when scripts >> >> > > > > are >> >> > > > > running since you never know when you might lose focus on your >> >> > > > > current >> >> > > > > task. >> >> >> > > > > If you want to do other work on the system while scripts are >> >> > > > > running, >> >> > > > > and the scripts use this kind of thing then your best bet is to >> >> > > > > run >> >> > > > > the tests inside a virtual machine, where what you do on the rest >> >> > > > > of >> >> > > > > your desktop will not affect the focus 'inside' the VM. If no a >> >> > > > > mac >> >> > > > > look into Virtual-Box, Parallels, or VMWare Fusion. (another >> >> > > > > advantage of this is that you can test on a platform such as >> >> > > > > Windows >> >> > > > > with IE/Firefox/Chrome so that you are not doing all your >> >> > > > > testing on >> >> > > > > a marginal platform that only a tiny minority of most web users >> >> > > > > would >> >> > > > > be using. (note I'm not a mac hater.. I'm typing this on a >> >> > > > > macbook >> >> > > > > pro, but for compatibility testing of webapps I mostly use >> >> > > > > Virtual-Box >> >> > > > > VM's that use XP or Win7, and IE/Chrome/Firefox since that's what >> >> > > > > around 90%+ of my users will be using. Using an external >> >> > > > > monitor, I >> >> > > > > can have scripts running in vm's on one screen (to keep an eye on >> >> > > > > them) and meanwhile do useful work on the other monitor. >> >> >> > > > > -- >> >> > > > > Before posting, please readhttp://watir.com/support. In short: >> >> > > > > search before you ask, be nice. >> >> >> > > > > [email protected] >> >> > > > >http://groups.google.com/group/watir-general >> >> > > > > [email protected] >> >> > -- >> > Before posting, please readhttp://watir.com/support. In short: search >> > before you ask, be nice. >> >> > [email protected] >> >http://groups.google.com/group/watir-general >> > [email protected] > > -- > Before posting, please read http://watir.com/support. In short: search before > you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected] -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
