MarketSquare / remoteswinglibrary

RemoteSwingLibrary
Apache License 2.0
31 stars 39 forks source link

acceptance tests may fail randomly when using Jython #42

Open WojtekKowaluk opened 8 years ago

WojtekKowaluk commented 8 years ago

When running with Jython (for example by executing mvn clean verify) on Windows and Linux (for some reason this never happens on OSX!) tests may fail randomly with Agent port not received before timeout error.

filipecduarte commented 8 years ago

I belive this don't work because jython can get the correct value for AGENT_PATH = os.path.abspath(os.path.dirname(file)) in RemoteSwingLibrary.py. If i change this and set the full path, start to work.

My sujection It is possible to in the import have as input the .jar path for the jython use cases?

WojtekKowaluk commented 8 years ago

Oh, it is true. If you put RSL in Java CLASSPATH there is issue with os.path.abspath(os.path.dirname(__file__). But if you put it in JYHONPATH instead, this line work with Jython. This issue is about other problem, which is random, so you may not know it.

filipecduarte commented 8 years ago

Ok. I use all in the classpath, i try to use the jythonpath. About the issue, yes i kwon and what i do is, use the process lib to start the application. After that i use application starter to catch the application. If fail, i kill the application and start again. I try 5 times, one work.

On Fri, Jul 22, 2016 at 1:24 PM, Wojtek Kowaluk notifications@github.com<mailto:notifications@github.com> wrote:

Oh, it is true. If you put RSL in Java CLASSPATH there is issue with os.path.abspath(os.path.dirname(file). But if you put it in JYHONPATH instead, this line work with Jython. This issue is about other problem, which is random, so you may not know it.

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/robotframework/remoteswinglibrary/issues/42#issuecomment-234529908, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AH6dFBFVHuYHTo8nB7rtY5GNQu_zfvryks5qYLZfgaJpZM4ICzws.

PeerMueller commented 8 years ago

We are also running in this problem using robot with the standalone jar. Unfortunately, this renders the library almost useless for us and we still have to use remoteapplications. Problems occur mainly with keyword "Application Started" while "Start Application" seems quite stable.

Is there something that can be done? Increasing the timeout does not help.

ehhc commented 7 years ago

Hi @PeerMueller I had the same problem using the standalon jar. I was using the jar in combination with grade. The problem is that os.path.abspath(os.path.dirname(__file__)) doesn’t lead to the correct path for the jar file and the javaagent dosen’t work therefore (it took quiet a lot of time to figure this out..). My workaround is a bit dirty, but works quite well: With grade I am able to figure out the path of the jar file and set it as a environment variable (“REMOTE_SWING_LIBRARY_JAR_PATH”). In my Robot file, I’m not using the RemotSwingLibrary way of starting a application but doing the following instead:

Start JNLP file
  [Arguments]  ${AppName}  ${JnlpUrl}

  Set Java Tool Options
  ${javatooloptions}=  Set Variable  -javaagent:"%{REMOTE_SWING_LIBRARY_JAR_PATH}"=127.0.0.1:${REMOTESWINGLIBRARYPORT}:DEBUG:CLOSE_SECURITY_DIALOGS
  Set Environment Variable  JAVA_TOOL_OPTIONS  ${javatooloptions}
  Start Process  javaws  ${JnlpUrl}  shell=True
  Application Started     ${AppName}  5 minutes

I hope, if somebody else runs into the same problem this might help to workaround of it. Even though I know that it isn’t a good solution but a dirty hack..

mel-exerp commented 5 years ago

@ehhc how did you read ${REMOTESWINGLIBRARYPORT} ?? Also something I really don't understand Should the RemoteSwingLibrary port be equivalent to JNLP port? or they should be different?? I still have the same exception with this solution because of ports!!! they are refused to open or sometimes gets timeout!!

ehhc commented 5 years ago

@mel-exerp if i remeber it correctly, you can simply access it by writing %{REMOTESWINGLIBRARYPORT}. see http://robotframework.org/robotframework/2.8.7/libraries/OperatingSystem.html#Get%20Environment%20Variable for further information

mel-exerp commented 5 years ago

No unfortunately you can't it gives error!! And it always gets error while running - even you set a specific port - connection time out, port refuse!! every time with different error!! Although these errors are fake, port is open... so I think there is a bigger issues in this jar!

It is really not working at all, and I decide to not waste more time with it!! But thanks for your reply

On Mon, Jul 29, 2019 at 5:13 PM ehhc notifications@github.com wrote:

@mel-exerp https://github.com/mel-exerp if i remeber it correctly, you can simply access it by writing %{REMOTESWINGLIBRARYPORT}. see http://robotframework.org/robotframework/2.8.7/libraries/OperatingSystem.html#Get%20Environment%20Variable for further information

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robotframework/remoteswinglibrary/issues/42?email_source=notifications&email_token=AMP4WWSKCBDT3ZXAFKJORGDQB4CKBA5CNFSM4CALHQWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3BA4NQ#issuecomment-516034102, or mute the thread https://github.com/notifications/unsubscribe-auth/AMP4WWU5NQW47EWGFGE2BKTQB4CKBANCNFSM4CALHQWA .

--

Marwa Elrayes

Senior Qualification Engineer | Exerp

m: +4552689084 | e: mel@exerp.com eda@exerp.co | exerp.com | LinkedIn https://www.linkedin.com/company/exerp

mel-exerp commented 5 years ago

No unfortunately you can't it gives error!! And it always gets error while running - even you set a specific port - connection time out, port refuse!! every time with different error!! Although these errors are fake, port is open... so I think there is a bigger issues in this jar!

It is really not working at all, and I decide to not waste more time with it!! But thanks for your reply