In Firebug I can see events in the Console like "click clientX=359, 
clientY=304" being sent to .  Can these events be sent to a Watir element?  

This works correctly in my case to do the default button action:

irb> browser.em( :class => "x-btn-split" ).fire_event 'click' 
=> false

But, if I substitute in what the Firebug console is showing me for a click 
in the correct place I get back "=> true" in irb and nothing happens in the 
browser:
irb> browser.em( :class => "x-btn-split" ).fire_event 'click clientX=359, 
clientY=304'
=> true

Is there a different syntax needed to send the event to the element with 
fire_event? 


On Monday, April 30, 2012 12:07:11 PM UTC-5, Chuck van der Linden wrote:
>
> I'd have to dig into the click code to be sure, but I could swear I've 
> never seen any logic to find the center of the element etc, I think it's 
> just firing events  (unless there is something way down inside webdriver)  
> If there is a way to do what you are asking, it's going to be down in the 
> underlaying webdriver code, not up at the watir api layer. 
>
> On Sunday, April 29, 2012 6:01:47 PM UTC-7, mndude wrote:
>>
>> Unfortunately the <em> takes up the same space as the button even though 
>> it sticks out a little bit on the right side.  So when clicking the <em> 
>> the click still happens in the middle and hits the button along the way.
>>
>> A real mouse click on the right side works fine manually in the browser. 
>>  Can Watir "fine tune" the click position somehow?
>>
>>
>> On Thursday, April 26, 2012 3:36:23 PM UTC-5, Chuck van der Linden wrote:
>>>
>>> The button only occupies the left portion of the EM that holds it. The 
>>> down arrow icon next to it is part of the container holding the button, so 
>>> if you are clicking the little down arrow icon you are clicking on the EM 
>>> or maybe the div/cell that holds the EM tag..  Maybe try clicking that 
>>> instead of the button and see what happens?  
>>>
>>> That could be a little tricky however since normally em is just a text 
>>> formatting tag ('emphasis') and is not an element watir supports since this 
>>> particular usage is well um er lets just say 'creative'.  So you might have 
>>> to identify it as a generic element and use the class or ID to select it.   
>>>
>>> You could also try clicking on the cell and see if that does anything 
>>> for you.
>>>
>>> If neither of those work then it might be time to talk to the ExtJS 
>>> folks and ask them how to automate this darned control  (I'm pretty sure 
>>> sikuli could do it if nothing else works) 
>>>
>>> On Wednesday, April 25, 2012 11:55:31 AM UTC-7, mndude wrote:
>>>>
>>>> I have a "split button" that when clicked in the middle or left side 
>>>> will perform a default action on that page.  But if clicked on the right 
>>>> side it will drop down a menu to select from a set of actions.  I can't 
>>>> get 
>>>> Watir webdriver to click and drop down the menu.  It only is able to click 
>>>> and perform the default action in the page.
>>>>
>>>> There is a similar item at 
>>>> http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/kitchensink/index.html#basic-toolbar
>>>>   
>>>> Try the Menu Button drop down
>>>>
>>>> The html of my button is somewhat similar to the link above and I'm 
>>>> having the same problem getting Watir webdriver to click on the right side 
>>>> and drop down the menu:
>>>>
>>>> <td class="x-btn-mc">
>>>>     <em id="ext-gen49" class="x-btn-split" unselectable="on" 
>>>> style="background-color: transparent;">
>>>>         <button id="ext-gen22" class=" x-btn-text" 
>>>> type="button">Add</button>
>>>>     </em>
>>>> </td>
>>>>
>>>>
>>>> Is there a way to get Watir webdriver to click somewhere besides the 
>>>> middle of an object?  I wonder if I could click a few pixels to the right 
>>>> of center if the menu would appear.  
>>>>
>>>

-- 
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]

Reply via email to