Hello!
We would like to control two Java FX application from the one test case. Below is simplified example from our test case (mytestcase.robot). I can control two UI instances via python code (see MyLib.py) but how the same functionality are done by robot keyword? We have already implemented one “middleware library” on top of JavaFXLibrary using robot keywords, and it is last option to port all this functionality to the python code.
Thanks in advance,
Tarmo
mytestcase.robot
*** Settings ***
Library Remote http://127.0.0.1:8270 WITH NAME JavaFXLibrary1
Library Remote http://127.0.0.1:8271 WITH NAME JavaFXLibrary2
Library MyLib.py
*** Test Cases ***
Menu Test
# This is working.
${args}= Create List javafxlibrary.testapps.MenuApp
Python Run Keyword JavaFXLibrary2 Launch Javafx Application ${args}
${args}= Create List text="Learn"
Python Run Keyword JavaFXLibrary2 Click On ${args}
${args}= Create List text="Test Automation & Robot Framework"
Python Run Keyword JavaFXLibrary2 Click On ${args}
# This is not working.
#${args}= Create List javafxlibrary.testapps.MenuApp
#Robot Run Keyword JavaFXLibrary2 Launch Javafx Application ${args}
#${args}= Create List text="Learn"
#Robot Run Keyword JavaFXLibrary2 Click On ${args}
#${args}= Create List text="Test Automation & Robot Framework"
#Robot Run Keyword JavaFXLibrary2 Click On ${args}
*** Keywords ***
Robot Run Keyword
[Arguments] ${libraryName} ${keyword} ${keywordParam}
# How to implement this method in order to get same functionality as in "Python Run Keyword"?
${fxLib}= Get Library Instance ${libraryName}
${fxLib} Run Keyword ${keyword} ${keywordParam}
MyLib.py
from robot.libraries.BuiltIn import BuiltIn
class MyLib:
def python_run_keyword(self, fxLibraryName, keyword, keywordParams):
BuiltIn().get_library_instance(fxLibraryName).run_keyword(keyword, keywordParams, None)