Re: [wtr-general] Browser instance not recognized by other modules

2017-12-08 Thread Jeff Fagot
I appreciate all your comments Chuck. AS you suggested I looked at Test Factory gem and you were right, it gives good nice view of how objects can be like. => I feel like I get the Object usage knowing I'll need practice to master it. I am still undecided on whether or not I will continue with

Re: [wtr-general] Browser instance not recognized by other modules

2017-12-08 Thread Chuck van der Linden
On Thursday, December 7, 2017 at 12:19:51 PM UTC-8, Jeff Fagot wrote: > > > So now, I would turn my question in a different angle: why is my Browser > instance @b declared in my *** ENVR.RB *** file known to my *** STEPDEF.RB > *** file? > Does it mean that Modules or Class are segregated from

Re: [wtr-general] Browser instance not recognized by other modules

2017-12-08 Thread Chuck van der Linden
On Thursday, December 7, 2017 at 12:19:51 PM UTC-8, Jeff Fagot wrote: > > Did not get a chance to dive into creating my first Class but I will do > asap. > I quite understand the concept of the Page Object (I will still need > practice to get to the understanding of where exactly should I use it

Re: [wtr-general] Browser instance not recognized by other modules

2017-12-07 Thread Jeff Fagot
Did not get a chance to dive into creating my first Class but I will do asap. I quite understand the concept of the Page Object (I will still need practice to get to the understanding of where exactly should I use it and how) and that is why I was looking into Classes yesterday. I guess what I

Re: [wtr-general] Browser instance not recognized by other modules

2017-12-07 Thread Titus Fortner
He isn't referring to a class for browser creation, but creating a page object class for using the browser, instead of using a module. Classes and modules are very similar in Ruby, but classes can be instantiated with instance variables, like a specific instance of a Browser object. Also, I

Re: [wtr-general] Browser instance not recognized by other modules

2017-12-06 Thread Jeff Fagot
Thanks Oscar for your input. I was just trying to learn about CLASS today and see how I could implement Class Objects...I guess you will get me started on it => I will try it out tonight But isn't Browser already a default Class Object of Watir? By following blogs, posts...I do not recall

Re: [wtr-general] Browser instance not recognized by other modules

2017-12-06 Thread Oscar Rieken
why not just create a class and pass the instance of the browser to that class or something like that its been a while since i have written ruby ###Somewhere Before do @browser = Watir::Browser.new :firefox end ###login.rb class Login def initialize(browser) @browser = browser end

[wtr-general] Browser instance not recognized by other modules

2017-12-06 Thread Jeff Fagot
Hello all, Main question == How to share the same browser instance across all my modules? Sub question 1 == What do you recommend between using hook.rb vs ruby module to instantiate a new Browser? Sub question 2 == Where do you store your modules? I explain: (I am using Cucumber+Watir) 1)