Stuck with another issue!! With ruby interactive i could see the time while accessing the browser(which is important in my scripting) but for fireevent the value is "nil" as shown:
irb(main):004:0* b = Watir::Browser.new => #<Watir::IE:0x287a2d0 url="about:blank" title=""> irb(main):005:0> irb(main):006:0* b.goto "http://srx-blue" => 1.96875 <<<<<<<<<<<<<<<<<<<<<<<<< irb(main):007:0> b.div(:id, "configure_access_left").fireEvent("onmouseup") => nil <<<<<<<<<<<<<< Please let me know if any alternative and to update, below methods did not help to click the div button except fireEvent("onmouseup"). browser.div(:id, "configure_access_left").click browser.div(:id, "configure_access_left").div(:class, "transparent- bwrap").click browser.div(:id, "configure_access_left").div(:class, "transparent- body transparent-body-noheader").click browser.div(:id, "configure_access_left").img(:src, "/gui-framework/ images/FolderOpen.gif").click On Mar 16, 5:15 pm, vin <[email protected]> wrote: > Regret for the delay since i was OOO. > > Thanks everyone!! its working with fireevent. > > ie.div(:id, "configure_access_left").fireEvent("onmouseup") > > Regards, > vin > > On Mar 3, 11:14 pm, Chuck van der Linden <[email protected]> wrote: > > > 'access' appears to be text.. do you see it on the page as text next > > to a 'FolderOpen" image? Is that text unique on the screen, or does > > it appear in other places as well? > > > The problem we are faced with here is that there are several > > overlapping HTML elements here, and none of the HTML types used here > > are normally 'reactive' on their own to being clicked. (as opposed to > > an <input> type such as a button) So there is somewhere that we > > cannot see here, behind the scenes 'plumbing' that sets up some of > > those elements to be sensitive to specific events, and run specific > > javscript when the events occur. I suspect this is configured at a > > class or style level, but unless you really want to dig around in the > > controls code that doesn't much matter. The issue is that of this > > sort of 'stack' of elements, we don't know which one is responsive to > > the click.. furthermore we don't know if it's looking for onclick, > > onmousedown, onmouseup, or whatever. > > > What you have going in your favor is you know the ID of the outer > > container, whcih makes it easier to try and click on it, OR one of the > > inner ones.. > > > You've got (periods used to force spacing) > > > <div id="configure_access_left" class="transparent x-abs-layout-item" > > style="font-size: 11px; top: 6px;"> > > . .<div id="ext-gen236" class="transparent-bwrap"> > > . . . <div id="ext-gen237" class="transparent-body transparent-body- > > noheader"> > > . . . . <img id="010200" src="/gui-framework/images/FolderOpen.gif"/> > > . . . . Access > > . . . </div> > > > What I would do is mess around using IRB to try clicking on each of > > these in turn using something like what I have below, and see if just > > a basic click on one of these works. > > > browser.div(:id, "configure_access_left").click > > browser.div(:id, "configure_access_left").div(:class, "transparent- > > bwrap").click > > browser.div(:id, "configure_access_left").div(:class, "transparent- > > body transparent-body-noheader").click > > browser.div(:id, "configure_access_left").img(:src, "/gui-framework/ > > images/FolderOpen.gif").click > > > The ones after the first are effectively saying 'look inside the div > > with the id configure_access_left and find the div with class xxxx and > > click on it) notice that you don't need to specify the entire path or > > nesting as you would with xpath. All that is needed is enough UNIQUE > > identifiers (or a combination that is unique) for watir to find the > > element you want. > > > If that doesn't work, then you may have to try firing events such as > > onmousedown or onmouseup in place of the click. > > > The other thing I'd strongly suggest is perhaps contacting the support > > folks for EXTJS, explain you are trying to automate testing of the > > site using their controls, and see if they can tell you what event (or > > sequence of events) needs to be fired at which class of divs in order > > to effect a 'click' > > > On Mar 2, 9:52 pm, vin <[email protected]> wrote: > > > > I need to use the first div which as static ID as > > > "configure_access_left": > > > > I have tried below methods but its not working: > > > b.div(:id, "configure_access_left").click > > > b.div(:id, "ext-gen236").click > > > > Also please let me know if i can make use of Access (marked <<<) to > > > achieve required click operation? > > > ### > > > .<div id="configure_access_left" class="transparent x-abs-layout-item" > > > style="font-size: 11px; top: 6px;"> > > > <div id="ext-gen236" class="transparent-bwrap"> > > > <div id="ext-gen237" class="transparent-body transparent-body- > > > noheader"> > > > <img id="010200" src="/gui-framework/images/FolderOpen.gif"/> > > > Access <<< > > > </div> > > > </div> > > > </div> > > > </div> > > > </div> > > > </div> > > > > Thanks, -- 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]
