Well, back to the original question, I was obviously able to cast in FireWatir. Is it possible to do this same action in SafariWatir?? :-)
On Dec 10, 5:57 pm, Charley Baker <charley.ba...@gmail.com> wrote: > Why would you not just use Cucumber, FIT, Selenesse? I would if that's > your goal, don't rewrite it. It's done and done. SLIM offers > something. Take a look at that. > > Charley Baker > Lead Developer, Watir,http://watir.com > > On Fri, Dec 10, 2010 at 3:53 PM, dave <davidrey...@gmail.com> wrote: > > Parsing the excel sheet is easy. > > > The trick is getting the non-Ruby writers to be able to write > > automations without having to know the full syntax of the language, > > the arguments req'd for each method, and not having to touch the code > > underneath in the framework. > > > What my manual testers see is a spreadsheet with columns > > Action | Element | Identifier | Keyword | Note1 | Note2 > > > so they can enter commands like > > > goto | | |www.yahoo.com| | | > > verify | link | text | Health > > verify | image | alt | Image Here | > > click | link | text | Healthy | NEGATIVETEST > > > ...knowing all the possibilities that automated scriptts can require, > > that's a lot of if...else... blocks!! or even case blocks! > > > However, say for "verify", if i cast the "element" column > > so that if i receive link-->Link and cast that to Link Class. > > image--> Image and cast that to Image Class. > > etc. > > Of course there is pre-verification it's in the right syntax. > > > Than I don't have a bunch of if ELement == Link then.. > > (and then all the possibilities that someone can request for a LInk > > check if exists--> id, name, text, etc...) > > > anyways, i got it to work with FireWatir. I was able to cast a > > FireWatir::Element insttance for each Element subclass, and i have to > > say, it covers all the row x column --> element X method grid pictured > > here > > -->http://pettichord.com/watirtutorial/docs/watir_cheat_sheet/WTR/Method... > > > ...So I was wondering why this isn't possible with SafariWatir.... > > > On Dec 10, 5:38 pm, Charley Baker <charley.ba...@gmail.com> wrote: > >> I have no idea without looking at your framework and even the first > >> bit seems wonky. I still don't understand why you're casting stuff and > >> going down that route. Use Roo maybe? for excel driven tests. I'd > >> personally go with a DSL, there are several available, if not then use > >> roo or something, don't invent your own. > > >> Charley Baker > >> Lead Developer, Watir,http://watir.com > > >> On Fri, Dec 10, 2010 at 3:26 PM, dave <davidrey...@gmail.com> wrote: > >> > Trying to implement keyword driven framework... Which works in > >> > FIreWatir. > > >> > Rather than doing some > > >> > if keywordrecieved == "verify" > >> > if element == "link" > >> > @safari.link(identifier,keyword).exists? > >> > if element == "image" > >> > @safari.image(identifier,keyword).exists? > >> > etc > > >> > I'd then have to repeat that for click and all methods for Element. > > >> > If I do this > >> > isCastedObjectExist = > >> > Object.const_get("FireWatir").const_get(sFireWatirClass).new(@ff,identifier,keyword).exists? > > >> > if FireWatir, it's pretty simple and of course with some pre- > >> > validation of identifier and keyword and sFireWatirClass, it's less > >> > code. I can also implement this for click and other Element methods. > > >> > THe alternative solution is a bloat of code. > > >> > I figured it out in FireWatir. Just having trouble implementing in > >> > SafariWatir. If I can just get hte casting part right, all this other > >> > stuff is reusable in SafariWatir for the most part. So that;s most of > >> > the Element methods, most of the web elements and two browsers in one > >> > shot and reusable. > > >> > I'd love to hear your alternative solution if you have some. I > >> > definitely have open ears. > > >> > On Dec 10, 5:12 pm, Charley Baker <charley.ba...@gmail.com> wrote: > >> >> I don't know your background but it sounds like you're a c/c++ > >> >> programmer. Casting and the other strange stuff you're trying to do, > >> >> has nothing to do with the way things are implemented. It has to do > >> >> with your background. Casting a string? Been there, done that, but > >> >> it's not Ruby. Chill out a bit and learn Ruby. And by that I don't > >> >> mean to be harsh, you're trying to bend the language and not bend > >> >> yourself. > > >> >> Charley Baker > >> >> Lead Developer, Watir,http://watir.com > > >> >> On Fri, Dec 10, 2010 at 2:23 PM, dave <davidrey...@gmail.com> wrote: > >> >> > I think, in my head, it might have something to do with the fact that, > >> >> > while it may use the same methods as Watir and FireWatir, it overrides > >> >> > it with calls to appscript... Which could mean trouble for what i'm > >> >> > trying to do... > > >> >> > On Dec 10, 2:36 pm, dave <davidrey...@gmail.com> wrote: > >> >> >> So I've been able to cast a string "Link" to a Firewatir::Link class > >> >> >> by the following: > > >> >> >> CastedObject = > >> >> >> Object.const_get("FireWatir").const_get("Link").new(@ff,identifier,keyword) > > >> >> >> which in place of "Link" allows me, with of course enough validation, > >> >> >> accept a dynamic string, ex. Link, Image etc. to allow me to > >> >> >> facilitate some Keyword/datadriven testing... :-) > > >> >> >> My problem is, I am trying to implement this on SafariWatir. > > >> >> >> CastedObject = > >> >> >> Object.const_get("Watir").const_get("Link").new(@safari,identifier,keyword) > > >> >> >> with @safari being > >> >> >> @safari = Watir::Safari.new(); > > >> >> >> gives me this exception: > > >> >> >> EXCEPTION:uninitialized constant Watir::Link > > >> >> >> Is there an hierarchy issue I'm missing? > > >> >> >> Thanks!! > > >> >> > -- > >> >> > 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 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 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