You may be able to offset the click. See referernce: http://stackoverflow.com/questions/14685418/how-to-click-on-a-specific-coordinates-of-an-element Alternately if the object can be tabbed to manually then set focus to the preceding element and .send_keys { : tab, ;enter }.
On Thursday, August 21, 2014 2:32:44 PM UTC-5, C G Emerson wrote: > > Hello all. > I am new to Ruby/Watir/Webdriver and am having trouble getting watir > webdriver to recognize the click on an image in IE when the image is > partially "behind" another image. > I can get Webdriver to recognize the click in Firefox and Chrome, just not > with IE9 (same issue in IE10 confirmed by a colleague) - although I have to > invoke the click a little differently between Firefox and Chrome (more > below). Ideally I would like to use the same script and just make the > browser a variable input. > > The relevant HTML goes something like** this : > > <div id= "containerofthings"> > <img id="containerimage" > > > <div id= "thing1"> > <img id=thing1image"> > </div> > <div id= "thing2"> > <img id=thing2image"> > </div> > </div> > > thing1image and thing2image are rectangular. thing2image is approx.1/4 > size of thing1image. thing2image has a z-index set to 1 and is positioned > via css to be at the top right quarter of thing1image like this: > > In all three browsers I'm testing, IE, FF and Chrome, *I can successfully > invoke a click on the thing2image with no issue*. > > The problem comes in when I try to click on thing1image. The behavior is > different in the different browsers being tested. > 1) Firefox - I can click on thing1image with no issues but the same is > not true on Chrome or IE. > 2) Chrome - I can invoke a click of thing1 (div) and that works in Chrome > but not in Firefox or IE. I can't invoke the click of thing1image as it > yields an error. > 3) IE9 - I tried click on the thing1image, but its registering as a click > on thing2image (no error message just not invoking the proper click > result). When the browser is launched through webdriver, I can't manually > click on thing1image until the script concludes running (it times out since > the element I'm looking for which results from the click isn't there). Once > webdriver is no longer running I can click on the thing1image and invoke > the processing as intended. I tried numerous options in IRB but wasn't able > to successfully invoke the click of thing1image. It's as though I can never > get "around" thing2image to reach thing1image. > > Has anyone seen this before and if so can you suggest how to resolve so I > can invoke the click in IE via Watir-Webdriver? > > If this should be cross posted to the Selenium group please let me know. > > ** Note: The real code is much more complex than this as the container div > is part of an element in a dynamic grid which is draggable and the > application uses JSF, PrimeFaces, JQuery etc. > > Installed versions are as follows: selenium-webdriver (2.42.0), test-unit > (2.0.0.0), watir-webdriver (0.6.10), ruby 2.0.0p481. > > Thank you! > -C > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.