Quantcast

keyPress not working?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

keyPress not working?

HS-10
Hi there,

I'm trying to do a keyPress on a input field. But it is not working, as I can't see anything typed into the field. I know that there is a type() method too, but I wanted to test the keyPress functionality.

So what I do is

selenium.setCursorPosition("id=inputField","0");
selenium.keyPress("id=inputField", "27");

Should this work like that?

Thanks for any hints and help.

Dominik
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5298&messageID=14731#14731

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: keyPress not working?

HS-10
hi,

if you are running your test in Internet exploree then use keyDown

if you are using Mozilla then use keyPress

regards,
Karthick
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5298&messageID=14733#14733

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: keyPress not working?

HS-10
I tried to do this using Firefox to simulates the "enter" key :

keyPress( myLocation, \10 )

It didn't work !!!!
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5298&messageID=14742#14742

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: keyPress not working?

Dan Fabulich
harmin wrote:

> I tried to do this using Firefox to simulates the "enter" key :
>
> keyPress( myLocation, \10 )
>
> It didn't work !!!!

keyPress isn't perfectly like hitting the Enter key on your keyboard.
What it really does is send a JavaScript "keyPress" event to the element
of your choice.  If the element handles "keyPress" events, then that will
make it do something.  If not, you won't see any effect.

Take a look at "TestKeyEvents.html" in Selenium Core for some examples.

-Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: keyPress not working?

HS-10
In reply to this post by HS-10
Hi,

I still can't get it to work. No matter it I try keyPress or keyUp.

That's what I found in the readme.txt under tests/events for selenium-core-0.8.0
Current Implementation:
-----------------------
Currently, only the focus, select, click, change and blur events are supported for elements of
types INPUT-TEXT, INPUT-RADIO, INPUT-CHECKBOX, INPUT-BUTTON and SELECT.

The focus event is not supported for the "window" object.

Other HTML events, together with all keyboard and mouse events are not currently emulated.

Does this mean, that keyPress/keyUp is supposed to work on INPUT-TEXT or not?
Is this supposed to work:
selenium.setCursorPosition("id=inputField","0");
selenium.keyPress("id=inputField", "s");
where in my HTML
<input type="text" class="gwt-TextBox" id="inputField"/>

Thanks for any help in advance and for the answers so far. :-)

Dominik
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5298&messageID=14794#14794

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: keyPress not working?

HS-10
I also am trying to get this to work.  I use selenium rc 0.8.2.  What is weird is that it works when I use selenium-ide directly with my browser window but doesn't work when using selenium-rc with the browser window created by selenium.

Anybody know why?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5298&messageID=17476#17476

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: keyPress not working?

HS-10
In reply to this post by HS-10
Hi there,

My client have a huge £7m financial backing from some very highly respected people who have made their millions in TV companies. My client based in London are highly dynamic and are rapidly expanding in the IPTV market. This is a fantastic opportunity to join them while they are still young, they will be looking to float on the stock market with 2-3 years! By that time with some hard work and dedication you will have worked yourself into a high level within the company.

They are currently seeking QA Automated / Manual testers to join their team.

You will be testing web applications in an agile environment. They are busy behind the scenes getting ready for launch that is set for around 6 months.

You will work very closely with the QA Manager, you will be carrying out both Automated and Manual testing on a .net / flash operating system. If you have experience with Selenium that is a major bonus! ISEB certifications are also desirable but not essential.

You can also work two days a week from home and will be provided with all the tools to do so. This is a fantastic opportunity to work with some very high level professionals and learn some new skills.

If you want to be considered, please send your CV to: [hidden email] or give me a call on: (0870)-013 6380 to discuss!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: keyPress not working?

HS-10
In reply to this post by HS-10
Helo :

I use the function KeyPress to simulate a enter value in a <input type=text>, and in Mozilla there isn't a error and shot it, but in Internet Explorer there isn't an error too, but NOT SHOW the value in the field.

How can I do to show it ? I use the Selenium core 0.8.2.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: keyPress not working?

HS-10
I'm afraid there is still an issue with key pressing simulation in Selenium. I've had troubles using it as well, but unfortunately didn't find a solution. Here's a thread I started some weeks ago:

http://forums.openqa.org/message.jspa?messageID=20975#20975

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: keyPress not working?

HS-10
In reply to this post by Dan Fabulich
Ok, so what if you want to simulate up/down/left/right arrow keys, and your element doesn't have a onKeyPress event tied to it?

I have a set of radio buttons which I want to scroll between using up/down arrow keys.

I tried
selenium.keyPress(id,'\\40");
for downarrow, but nothing happens.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: keyPress not working?

HS-10
Have you tried keyDown + keyUp instead? Perhaps the problem is in IE and not Firefox, correct?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...