Re: [Wtr-general] right click???

2006-09-12 Thread Zeljko Filipin
David,I was just qouting (the other) David's question. He should answer.ZeljkoOn 9/11/06, David Schmidt <
[EMAIL PROTECTED]> wrote:Željko, are you sure that the right click event was in the DIV and not in another element inside of the DIV?

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] right click???

2006-09-11 Thread David Schmidt
Bret Pettichord wrote:
> The problem in this case is exactly what it says. A DIV element in the
>   
>> DOM doesn't *have* a fireEvent OLE call.  (I just brought up IRB, 
>> attached to an IE window open to unittests/html/div.html, assigned the 
>> first DIV element to a variable and then had it show me all the valid 
>> OLE methods:
>>
>> irb(main):001:0> require 'watir'
>> => true
>> irb(main):002:0> include Watir
>> => Object
>> irb(main):020:0> ie = IE.attach(:title, /Div/);nil
>> => nil
>> irb(main):021:0> d = ie.div(:id, 'div1');nil
>> => nil
>> irb(main):022:0> d.document.ole_methods
>> => [setAttribute, getAttribute, removeAttribute,...
>>
>> No fireEvent, as the error message below stated.
>>
>> Željko, are you sure that the right click event was in the DIV and not in 
>> another element inside of the DIV?
>>   
>> 
> David (OP):
>
> This may be a bug in fire_event in 1.5.
>
> Does this work? (or at least give a different error message?)
>
> div = ie.div(:id, "detailProposal0610760")
> div.locate
> dif.fire_event("rightclick")
>
> Bret
>   
I did mispeak a bit above.  It's the "rightclick" that I don't see as an 
event to fire.  "onClick" works, but trying to do a fire_event of 
"rightclick" doesn't find that event to fire.  The ole_methods will show 
all OLE methods available for that element, and while you can do an 
"onClick" and a number of other events on a DIV, I don't see any 
"rightclick" listed.

David
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-11 Thread Bret Pettichord
The problem in this case is exactly what it says. A DIV element in the
> DOM doesn't *have* a fireEvent OLE call.  (I just brought up IRB, 
> attached to an IE window open to unittests/html/div.html, assigned the 
> first DIV element to a variable and then had it show me all the valid 
> OLE methods:
>
> irb(main):001:0> require 'watir'
> => true
> irb(main):002:0> include Watir
> => Object
> irb(main):020:0> ie = IE.attach(:title, /Div/);nil
> => nil
> irb(main):021:0> d = ie.div(:id, 'div1');nil
> => nil
> irb(main):022:0> d.document.ole_methods
> => [setAttribute, getAttribute, removeAttribute,...
>
> No fireEvent, as the error message below stated.
>
> Željko, are you sure that the right click event was in the DIV and not in 
> another element inside of the DIV?
>   
David (OP):

This may be a bug in fire_event in 1.5.

Does this work? (or at least give a different error message?)

div = ie.div(:id, "detailProposal0610760")
div.locate
dif.fire_event("rightclick")

Bret


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-11 Thread Egil Sorensen
Take a look at "How to trigger event programmatically?", dated Aug 9 2004, at 
http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/27e7c70e51ff8a99/98cea9cdf065a524?lnk=st&q=javascript+trigger+the+event+for+right&rnum=3&hl=en#98cea9cdf065a524

Michael Winter's reply to the question shows one way to simulate 
right/middle/left mouse clicks. However he goes on to write:

  "...Of course IE will have none of this. Whilst you can dispatch artificial  
  events into the document tree (using Element.fireEvent), only listeners  
  will be dispatched. Actions associated with that event will not be  
  performed. ..."

Don't know if that means that Watir is totally barred from getting the standard 
context menu to pop up.

~~ Egil
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4007&messageID=11270#11270
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-11 Thread David Schmidt
This has nothing to do with the performance enhancements, and aside from 
the bug where I didn't check for a regexp being fed to getElementById() 
(which I fixed) I haven't seen any signs of that performance fix being 
"unreliable".  All tests pass, including the ones I added to check for 
being able to use a regexp to match an :id, which weren't there or I 
would have caught the bug the first time.

The problem in this case is exactly what it says.  A DIV element in the 
DOM doesn't *have* a fireEvent OLE call.  (I just brought up IRB, 
attached to an IE window open to unittests/html/div.html, assigned the 
first DIV element to a variable and then had it show me all the valid 
OLE methods:

irb(main):001:0> require 'watir'
=> true
irb(main):002:0> include Watir
=> Object
irb(main):020:0> ie = IE.attach(:title, /Div/);nil
=> nil
irb(main):021:0> d = ie.div(:id, 'div1');nil
=> nil
irb(main):022:0> d.document.ole_methods
=> [setAttribute, getAttribute, removeAttribute,...

No fireEvent, as the error message below stated.

Željko, are you sure that the right click event was in the DIV and not in 
another element inside of the DIV?

David Schmidt



Bret Pettichord wrote:
> I believe that this is bug introduced by the recent performance 
> enhancement to Watir that needs to be backed out until it can be made 
> more reliable.
>
> Unrelated to the error message, there is on "rightclick" javascript 
> event. I read my JavaScript book on the topic and it said that the event 
> is "onClick" but that you have to set the button bits on the event. I'm 
> not sure exactly how this would be done.
>
> Bret
>
> Zeljko wrote:
>   
>> This is out of my league. Anybody familiar with this error message?
>>
>> Željko
>>
>>   
>> 
>>> ie.div(:id,
>>> "detailProposal0610760").fire_event("rightclick")
>>>
>>> It highligts it like it wants to do something but
>>> never acts as a right click. This is the message in
>>> the prompt that I get if that helps.
>>>
>>> C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2039:in
>>> `method_missing': fireEvent (WIN
>>> 32OLERuntimeError)
>>> OLE error code:80070057 in htmlfile
>>>   Invalid argument.
>>>   HRESULT error code:0x80020009
>>> Exception occurred.   from
>>>  C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:203
>>> :in `fire_event'
>>> from ../test/test2.rb:180
>>> 
>>>   
>> -
>> Posted via Jive Forums
>> http://forums.openqa.org/thread.jspa?threadID=4007&messageID=11218#11218
>> ___
>> Wtr-general mailing list
>> Wtr-general@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/wtr-general
>>   
>> 
>
> ___
> Wtr-general mailing list
> Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>   

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-11 Thread Bret Pettichord
I believe that this is bug introduced by the recent performance 
enhancement to Watir that needs to be backed out until it can be made 
more reliable.

Unrelated to the error message, there is on "rightclick" javascript 
event. I read my JavaScript book on the topic and it said that the event 
is "onClick" but that you have to set the button bits on the event. I'm 
not sure exactly how this would be done.

Bret

Zeljko wrote:
> This is out of my league. Anybody familiar with this error message?
>
> Željko
>
>   
>> ie.div(:id,
>> "detailProposal0610760").fire_event("rightclick")
>>
>> It highligts it like it wants to do something but
>> never acts as a right click. This is the message in
>> the prompt that I get if that helps.
>>
>> C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2039:in
>> `method_missing': fireEvent (WIN
>> 32OLERuntimeError)
>> OLE error code:80070057 in htmlfile
>>   Invalid argument.
>>   HRESULT error code:0x80020009
>> Exception occurred.   from
>>  C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:203
>> :in `fire_event'
>> from ../test/test2.rb:180
>> 
> -
> Posted via Jive Forums
> http://forums.openqa.org/thread.jspa?threadID=4007&messageID=11218#11218
> ___
> Wtr-general mailing list
> Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>   

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-11 Thread Zeljko
This is out of my league. Anybody familiar with this error message?

Željko

> ie.div(:id,
> "detailProposal0610760").fire_event("rightclick")
> 
> It highligts it like it wants to do something but
> never acts as a right click. This is the message in
> the prompt that I get if that helps.
> 
> C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2039:in
> `method_missing': fireEvent (WIN
> 32OLERuntimeError)
> OLE error code:80070057 in htmlfile
>   Invalid argument.
>   HRESULT error code:0x80020009
> Exception occurred.   from
>  C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:203
> :in `fire_event'
> from ../test/test2.rb:180
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4007&messageID=11218#11218
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-08 Thread David
I posted what I get in the prompt in the post above yours(added it in) It 
should bring up a small pop up window smiliar to if you right click any where 
on a webpage, with just different options.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4007&messageID=11076#11076
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-08 Thread Zeljko Filipin
What should right click do?Do you get an error, or just nothing happens?Zeljko
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] right click???

2006-09-08 Thread David
I have been actually using a variation of that and it wont work 


ie.div(:id, "detailProposal0610760").fire_event("rightclick")   



It highligts it like it wants to do something but never acts as a right click.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4007&messageID=11071#11071
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] right click???

2006-09-08 Thread Zeljko Filipin
Try something like:ie.text_field(:name, "my_field").fire_event("rightclick")(from http://wiki.openqa.org/display/WTR/FAQ#FAQ-TriggeringJavaScriptevents
)Zeljko
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] right click???

2006-09-07 Thread David
Here I go with another newb question, how can you do a right click? instead of 
.click would it be .rightclick? I do look for the answers before I post these 
things, but im lost again.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4007&messageID=10999#10999
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Right-click menu.

2006-03-27 Thread Zeljko Filipin
Maybe this would help.http://wiki.openqa.org/display/WTR/FAQ#FAQ-TriggeringJavaScriptevents
On 3/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
This email is to be read subject to the disclaimer below.


Hello guys,

I imagine this question has been ask
a number of times, but I couldn't find any clear references on the Web,
so...

How do I automate a click in a context
menu (ie. right-click on a page and click on a menu item)?

thank you very much.

Best Regards

Leon 
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] Right-click menu.

2006-03-27 Thread Leon . Ouretski
This email is to be read subject to the disclaimer below.


Hello guys,

I imagine this question has been ask
a number of times, but I couldn't find any clear references on the Web,
so...

How do I automate a click in a context
menu (ie. right-click on a page and click on a menu item)?

thank you very much.

Best Regards

Leon



NOTICE - This communication contains information which is confidential and the copyright of Ernst & Young or a third party. 

If you are not the intended recipient of this communication please delete and destroy all copies and telephone Ernst & Young on 1800 655 717 immediately. If you are the intended recipient of this communication you should not copy, disclose  or distribute this communication without the authority of Ernst & Young.

Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Ernst & Young.

Except as required at law, Ernst & Young does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

Liability limited by a scheme approved under Professional Standards Legislation.




If this communication is a "commercial electronic message" (as defined in the Spam Act 2003) and you do not wish to receive communications such as this, please forward this communication to [EMAIL PROTECTED]___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] right-click event

2005-09-10 Thread Danny Yuan

Hi,

May I know how to fire an event for right click? 
fireEvent("oncontextmenu") does not bring up the treeview's context menu 
(the context menu is constructed by JavaScript). Firing oncontextmenu 
simply highlight the link being clicked to bright yellow instead of 
bring up the expected  context menu. Therefore, I was wondering if there 
are any other ways of firing "right-click" event. Say, can I fire 
onMouseDown with specifying that the mousekey=2? Thanks a lot! By the 
way, Watir is truely amazing. With a few hours of trial-and-error (and I 
do not know much about Ruby yet), I can do really smoothly what 
QuickTest Professional just can't handle well enough. Thanks for the 
awesome tool.

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general