How to press any key by Jubula's Java API [message #1809549] |
Thu, 18 July 2019 03:32  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03612 seconds