Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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: 255
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 messageGo to next message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 255
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
Re: How to press any key by Jubula's Java API [message #1831513 is a reply to message #1810049] Fri, 21 August 2020 12:28 Go to previous message
Nidhi Kashyap is currently offline Nidhi KashyapFriend
Messages: 21
Registered: August 2020
Junior Member
Hi All,

was this issue resolved ? I am stuck in a similar issue .

I am trying to pass a parameter to press alt and space. I writing the below code :

Application app=SwingComponents.createApplication();
app.KeyCombination(ValueSets.Modifier["alt"],"SPACE");

KeyCombinations take 2 parameters firstly Modifier[] and secondly a string.
But I am getting error ValueSets.Modifier cannot be resolved to a variable.

Please let me know what should be the parameter passed for pressing Alt and Space.

Previous Topic:Creating Test Framework and writing test cases in Java in Jubula
Next Topic:Selenium Webdriver
Goto Forum:
  


Current Time: Thu Apr 18 23:44:43 GMT 2024

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

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

Back to the top