-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RemoteSwingLibraryTimeoutError: Agent port not received before timeout #33
Comments
This is bit urgent can some please help me on this ? @pekkaklarck |
I am also running into this exact problem, whereby the JNLP file I am required to test does not start when instantiated from within Robot Framework using RemoteSwingLibrary Start Application keyword. I also get the same error: RemoteSwingLibraryTimeoutError: Agent port not received before timeout Environment details |
Is your application take long to start? Have you tried to set |
Hey, thanks for your reply! I'm just working with the Oracle Notepad JNLP as a proof of concept. The app takes seconds to start outside of RF. I have not set a timeout and I believe this defaults to 60 seconds? Setting a longer timeout does not seem to help. I am attempting to start the app like this: Start Application test-app javaws ${JNLP} 31337 JNLP variable resolves to the location of the JNLP file on disk. When I run the same command from the commandline, the JNLP app does start. Output from report: Failed to start application: Traceback (most recent call last): Thanks for your help! |
It happen all the time or randomly? You mentioned maven plugin. May it be that your test run with jybot? There is known issue about such setup: #42 I think bug maybe inside Jython, so it is hard for me to fix. Can you try to run with pybot instead of jybot? |
It happens all the time - I've just tried the same tests with pybot and things do work as expected. Thanks for the pointer Wojtek. So it does not seem to be the same issue, sorry about that! |
@balak143 Do you still have this problem? Some improvments were made, so this may be fixed in lastest version. |
Hi @WojtekKowaluk I am getting the same error "RemoteSwingLibraryTimeoutError('Agent port not received before timeout')". Here's my configuration: RobotFramework version: Robot Framework 3.0 (Python 2.7.12 on win32) java -version: java version "1.8.0_101" RIDE 1.5.2.1 running on Python 2.7.12. RemoteSwingLibrary: 2.2.0 Test case: *** Test Cases *** I am using both Pybot and jybot but the result is same. After I run the tests, my swing app opens immediately and the keyword "Start Application" fails with the following error: Please find the attached files for further info: |
@WojtekKowaluk @jussimalinen Can you please help me ? |
Hi Import Library OperatingSystem The Start Application from the OperatingSystem you need the -javaagent: option as After the RemoteSwingLibrary import you have: |
Thanks @filipecduarte for the reply. I was trying out a few things and I imported OperatingSystem. I hope I wouldn't need it to reproduce the issue. Anyway, I think I figured out the issue. The problem is, my application waits for the user action/input (e.g. entering the username and password, clicking on login or exit buttons etc). and until the user enters or does something it just keeps waiting. And in "SwingLibrary" I had the choice of using the keyword "Start Application In Separate Thread" so I didn't face any problem at all. But looks like that keywoprd is not supported in RemoteSwingLibrary. So is there any equivalent keyword in RSL, which does the same job of "Start Application In Separate Thread" ? I tried options like starting application using a shell script etc. but the execution hangs at "Application Started" with the same error. |
The only workaround I see as of now is entering the username and password manually while the Robot Test is in the process of running the "Start Application" keyword. None of the RSL(from 2.1.0 to 2.2.0) seem to work. They just throw the same error "RemoteSwingLibraryTimeoutError: Agent port not received before timeout" even after doing the things manually. But surprisingly RSL 2.0.3 is working. Please find the logs below pybot when RSL2.0.3 was used.txt pybot when RSL2.2.0 was used.txt I simplified the test case as below: *** Settings *** *** Test Cases *** |
Hello, I see two separate issues here.
RSL use some heuristics to find correct security context it should connect to. if application shows some dialog windows before it shows main windows it can cause some problem. I think heuristic may be improved to support your case, but it require lot of research.
This is interesting regression and probably something we can fix easily if we find root case. Let me know if you have any more info. |
Thanks @WojtekKowaluk for the reply. Please find the attached logs files you asked about. I didn't find anything interesting other than a info messages. The only extra line I saw when I used RSL 2.2.0 is "Picked up _JAVA_OPTIONS: -Djava.security.policy="c:\temp\grant_all_kes0ad.policy" RSL_2.2.0_remote_stdout_98655461-9e7a-4fa5-a8cb-b830b59bff9e.txt . |
I am having the same issue as reported by @badari412. The difference however is that I use Java WebStart. I have tried increasing the timeout in addition to the arguments taken by the Wait Until Keyword Succeeds keyword. Keyword 'Java Webstart' failed after retrying for 1 minute. The last error was: RemoteSwingLibraryTimeoutError: Agent port not received before timeout I have a login screen that gets displayed before the main window. Do you have any possible suggestions for a workaround? I am not using Jython, just python version 3.3.5, Java 8+ and 2.2.0 of RSL. Thank You and a Happy New Year 2017!! |
@KenchuG I am not sure if I can help you but did you try setting timeout parameter ? May be your application is taking too long to start? I couldn't proceed with RemoteSwingLibrary because of the issues I mentioned above. SwingLibrary (using jython) helped me though. |
Any update to fix following ... |
We tried to reproduce this issue but it is difficult to do it without a concrete example. Sometimes this might happen because the environment is not properly set. As a first step we would recommend to reset the |
As i started with the latest & greates 2.2.2, i was hit with very similar issue like this - eg starting webstart application and getting connection timeout. As pointed out, 2.0.3 was apparently working but due to python3 support only coming with 2.1.0, i tried that and that also did work so i iterated over all releases since 2.1.0 and only one where i get this particular issue is within 2.2.2 release. Last working one for me: 2.2.1 Versions:
test.robot:
run.cmd:
|
This caused similar issues as report in in #33 albeit, it can't be the root cause for that particular report as the change that caused this was done after the bug was reported. Anyway, the bug here was that as there was no existing policy file, javaagent didnt have permissions to connect RSL server, thus causing agent timeout.
20:04:43.178 | INFO | Failed to start application: Traceback (most recent call last): File "C:\xxxx\remoteswinglibrary-2.2.4.jar\RemoteSwingLibrary.py", line 433, in start_application self._application_started(alias, timeout, name_contains, remote_port, accept_old=False) File "C:\xxx\remoteswinglibrary-2.2.4.jar\RemoteSwingLibrary.py", line 485, in _application_started self._wait_for_api(url) File "C:\xxx\remoteswinglibrary-2.2.4.jar\RemoteSwingLibrary.py", line 472, in _wait_for_api raise RuntimeError('Connecting to api at %s has failed: %s' % (url, error)) RuntimeError: Connecting to api at 127.0.0.1:42145 has failed: '' |
Hi all, I spent too much time on this 'issue'. In my case, it was the wrong interpretation of documentation and wrong syntax. Here is the version of the *.robot file which eventually worked for me: *** Settings ***
Library OperatingSystem
Library RemoteSwingLibrary debug=True
Test Setup Run Keyword Start My App
Test Teardown Run Keyword Close My App
*** Keywords ***
Start My App
Start Application myAppAlias javaws ${JNLP_URL} timeout=360
Close My App
System Exit With that syntax, timeout is acknowledged. I run robot (Robot Framework 3.2.1 (Python 3.8.2 on win32)) from CLI (cmdr emulator) in Windows 10 environment. |
Hi I still get an error even I use the script
|
I am getting below error while application is running the below script from RIDE(java web start application). It opens the swing application correctly but later i get this error.
Could you please help me on this ?
Environment details :
Java : 1.7.0_55
RIDE 1.5 running on Python 2.7.6.
robotframework 2.8.3
remoteswinglibrary2.0.3
*** Settings ***
Library RemoteSwingLibrary
*** Variables ***
${JNLP URL} webice.jnlp
*** Test Cases ***
Testing java application
Set Log Level DEBUG
Start Application myjavawsapp javaws -verbose webice.jnlp 180
LOG When I run with JYBOT :
Starting test: RemoteSwing.Testing java application
20151124 19:46:05.003 : INFO : Log level changed from INFO to DEBUG
20151124 19:46:05.018 : INFO : Link to stdout
20151124 19:46:05.018 : INFO : Link to stderr
20151124 19:46:05.018 : INFO :
Starting process:
javaws -verbose webice.jnlp
20151124 19:47:05.032 : INFO :
Failed to start application: Traceback (most recent call last):
File "E:\RemoteSwing\remoteswinglibrary-2.0.3.jar\RemoteSwingLibrary.py", line 295, in start_application
self._application_started(alias, timeout=timeout, name_contains=name_contains, accept_old=False)
File "E:\RemoteSwing\remoteswinglibrary-2.0.3.jar\RemoteSwingLibrary.py", line 321, in _application_started
url = self._get_agent_address(name_contains, accept_old)
File "E:\RemoteSwing\remoteswinglibrary-2.0.3.jar\RemoteSwingLibrary.py", line 342, in _get_agent_address
raise RemoteSwingLibraryTimeoutError('Agent port not received before timeout')
RemoteSwingLibraryTimeoutError: Agent port not received before timeout
20151124 19:47:05.051 : INFO : Waiting for process to complete.
20151124 19:47:05.055 : INFO : Process completed.
20151124 19:47:05.058 : INFO : STDOUT:
20151124 19:47:05.060 : INFO : STDERR:
20151124 19:47:05.062 : FAIL : RemoteSwingLibraryTimeoutError: Agent port not received before timeout
Ending test: RemoteSwing.Testing java application
LOG When I run with PYBOT:
Starting test: RemoteSwing.Testing java application
20151124 16:17:01.097 : INFO : Log level changed from INFO to DEBUG
20151124 16:17:01.097 : INFO : Link to stdout
20151124 16:17:01.097 : INFO : Link to stderr
20151124 16:17:01.097 : INFO :
Starting process:
javaws -verbose webice.jnlp
20151124 16:20:01.115 : INFO :
Failed to start application: Traceback (most recent call last):
File "E:\RemoteSwing\remoteswinglibrary-2.0.3.jar\RemoteSwingLibrary.py", line 295, in start_application
self._application_started(alias, timeout=timeout, name_contains=name_contains, accept_old=False)
File "E:\RemoteSwing\remoteswinglibrary-2.0.3.jar\RemoteSwingLibrary.py", line 321, in _application_started
url = self._get_agent_address(name_contains, accept_old)
File "E:\RemoteSwing\remoteswinglibrary-2.0.3.jar\RemoteSwingLibrary.py", line 342, in _get_agent_address
raise RemoteSwingLibraryTimeoutError('Agent port not received before timeout')
RemoteSwingLibraryTimeoutError: Agent port not received before timeout
20151124 16:20:01.116 : INFO : Waiting for process to complete.
20151124 16:20:01.117 : INFO : Process completed.
20151124 16:20:01.117 : INFO : STDOUT:
20151124 16:20:01.119 : INFO :
STDERR: Picked up JAVA_TOOL_OPTIONS: -javaagent:"E:\RemoteSwing\remoteswinglibrary-2.0.3.jar"=127.0.0.1:64697
Exception: java.lang.IllegalStateException thrown from the UncaughtExceptionHandler in thread "JNIWrapper.ShutdownHook"
20151124 16:20:01.123 : FAIL : RemoteSwingLibraryTimeoutError: Agent port not received before timeout
Ending test: RemoteSwing.Testing java application
STD ERROR :
Picked up JAVA_TOOL_OPTIONS: -javaagent:"E:\RemoteSwing\remoteswinglibrary-2.0.3.jar"=127.0.0.1:64697
Exception: java.lang.IllegalStateException thrown from the UncaughtExceptionHandler in thread "JNIWrapper.ShutdownHook"
The text was updated successfully, but these errors were encountered: