BUG: Jenkins - Batch - Emulators

Bug reports.
darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

BUG: Jenkins - Batch - Emulators

Post by darius.popa » Fri Feb 21, 2014 12:15 pm

Hello,

I have a problem. I am using Jenkins and I am running the tests using a batch file. From Jenkins it trows the following error
error.png
error.png (112.33 KiB) Viewed 1686 times
When I am running manually (double click on batch file), using exactly the same files, the tests are running successfully.
I'm using Ranorex 4.1.4 with Windows 7 64 Bit

Thank you,

Darius

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: Jenkins - Batch - Emulators

Post by krstcs » Fri Feb 21, 2014 2:26 pm

When you run the batch file manually, are you running it from withing the folder where your test's EXE is?

If so, your problem is probably that Jenkins is not in the correct working directory when it starts the batch file. In Jenkins (or the batch file) add a "cd \<Directory where your test resides>" before you run the batch/test.
Shortcuts usually aren't...

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: BUG: Jenkins - Batch - Emulators

Post by darius.popa » Fri Feb 21, 2014 2:30 pm

No, the batch files are on the Desktop and the exe file is where Ranorex generates it.
I'm changing directory before running the tests.

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: BUG: Jenkins - Batch - Emulators

Post by darius.popa » Mon Feb 24, 2014 2:57 pm

Also, when I try to instrument apk file from Jenkins (batch plugin), I receive this error
"Cannot continue because no Java Runtime Environment (JRE 1.6) is configured. Please install Java 1.6 and start the Ranorex InstrumentationWizard to see if the runtime can be detected/configured."

As far as I see, Jenkins does not recognize local Ranorex installation.
I mention that running manually (double click on batch file) exactly the same commands (copy - paste into a batch file) the tests are running successfully.

Thank you,
Darius

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: Jenkins - Batch - Emulators

Post by krstcs » Mon Feb 24, 2014 3:04 pm

This isn't a Jenkins issue, it's a Ranorex issue. Jenkins has no knowledge of Ranorex and the Instrumentation Wizard. That error is from Ranorex's run-time system.

I would suggest you uninstall Ranorex from the system and re-install it. See if that helps. It appears that it didn't get all of its hooks into the system the first time. (You could try using the instrumentation wizard to just install the Java plugin as well, but I would recommend a clean re-install first.)

Make sure all needed versions of Java are installed first.
Shortcuts usually aren't...

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: BUG: Jenkins - Batch - Emulators

Post by darius.popa » Mon Feb 24, 2014 3:22 pm

I tried a fresh install, the same behavior, I'm out of ideas :(

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: BUG: Jenkins - Batch - Emulators

Post by odklizec » Mon Feb 24, 2014 3:28 pm

It definitely sounds like incorrect working directory issue? Could you please show us the command line you use for starting the test from Jenkins (screenshot from Jenkins job). And how/where you change the directory before running the test command line?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: BUG: Jenkins - Batch - Emulators

Post by darius.popa » Mon Feb 24, 2014 4:06 pm

Hello,

This is the Jenkins job
jenkins job.png
jenkins job.png (32.26 KiB) Viewed 1659 times
Thanks,
Darius

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: BUG: Jenkins - Batch - Emulators

Post by odklizec » Mon Feb 24, 2014 4:51 pm

It looks OK to me, but I'm not so experienced with Android instrumentation and testing ;)

OK, you mentioned the test starts OK if started from the batch file? So what about replacing whole Jenkins batch with simple call of the bat file? Just to try what will happen.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: BUG: Jenkins - Batch - Emulators

Post by darius.popa » Mon Feb 24, 2014 5:09 pm

I tried that, the same :(

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: BUG: Jenkins - Batch - Emulators

Post by odklizec » Mon Feb 24, 2014 6:01 pm

And it still works if you run the batch manually (by double clicking the batch file)?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: BUG: Jenkins - Batch - Emulators

Post by darius.popa » Tue Feb 25, 2014 8:44 am

Yes

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: BUG: Jenkins - Batch - Emulators

Post by darius.popa » Thu Feb 27, 2014 9:53 am

Did someone have any ideas on this?
Currently I am using a workaround. I created a test suite which clicks on the batch files and it's working fine. So, the problems appears when the Android is used.

Thank you,
Darius