Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » How to press any key by Jubula's Java API
How to press any key by Jubula's Java API [message #1809549] Thu, 18 July 2019 03:32 Go to next message
Li Huan is currently offline Li HuanFriend
Messages: 7
Registered: April 2019
Junior Member
Hello,
I know there is a way to press any key by using the concrete method "press
any key" in jubula client. But how to realize it by using java code?I mean what's the Jubula's java API to press key?What package should I import?What function shoud I call?
Re: How to press any key by Jubula's Java API [message #1809553 is a reply to message #1809549] Thu, 18 July 2019 07:04 Go to previous messageGo to next message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 192
Registered: March 2012
Senior Member
Hello, there is the action keyCombination in the Application class.
Get your Application object:
Application application  = SwingComponents.createApplication();
(or if you are using the Handlers:ApplicationActionHandler application = SwingComponents.createApplicationActionHandler();)

Do a key combination:
application.keyCombination(modifierKeys, baseKey)


best regards
Marvin Mueller
Re: How to press any key by Jubula's Java API [message #1809860 is a reply to message #1809553] Thu, 25 July 2019 02:30 Go to previous messageGo to next message
Li Huan is currently offline Li HuanFriend
Messages: 7
Registered: April 2019
Junior Member
Thanks!but when I follow your way, It reminds me that incompatible types. How to resolve this?

import org.eclipse.jubula.toolkit.swing.SwingComponents;
import org.eclipse.jubula.toolkit.swing.components.Application;

Application application = SwingComponents.createApplication(); // Compilation error occurred in this line. "requeired org.eclipse.jubula.toolkit.swing.components.Application but found org.eclipse.jubula.toolkit.concrete.components.Application"
Re: How to press any key by Jubula's Java API [message #1810049 is a reply to message #1809860] Tue, 30 July 2019 06:22 Go to previous message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 192
Registered: March 2012
Senior Member
than use the org.eclipse.jubula.toolkit.concrete.components.Application in the import. This is a more general implementation of the Swing Components. Sometimes there might even not be a swing implementation but only the concrete one(since Swing is not introducing more actions).

best regards
Marvin Mueller
Previous Topic:Issues setting up AUT
Next Topic:can't install Jubula on windows xp32
Goto Forum:
  


Current Time: Sat Nov 16 02:22:53 GMT 2019

Powered by FUDForum. Page generated in 0.01622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top