Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357059 - Taking screenshots does not work using testexec
Summary: Taking screenshots does not work using testexec
Status: CLOSED WORKSFORME
Alias: None
Product: Jubula
Classification: Technology
Component: Tools (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: Indigo SR2   Edit
Assignee: Project Inbox CLA
QA Contact: Oliver Goetz CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-08 07:12 EDT by Niklaus Giger CLA
Modified: 2012-02-23 02:48 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niklaus Giger CLA 2011-09-08 07:12:04 EDT
Build Identifier: 5.1.00156

ub_app_takeScreenshotOfActiveWindows works fine when running Jubula-GUI.

No *.png screenshots were created when running the same job using testexec.

I tested this behaviour under Linux (Debian Squeeze/Wheezy) and Windows7.

Should be easy to reproduce. 

Code for the application and script running this test can be found under
https://bitbucket.org/ngiger/jubula-elexis and


Reproducible: Always

Steps to Reproduce:
1. https://bitbucket.org/ngiger/jubula-elexis 
2. cd jubula-elexis
3. ./run_jenkins.rb
Assumes a ruby, wget and jubula (installed under /opt/jubula_5.1.00156).
./run_jenkins.rb -h gives some ideas how to adapt the script to your environment.
Comment 1 Alexandra Schladebeck CLA 2011-09-08 10:31:20 EDT
We are unable to reproduce this issue - could it be that the place you are looking for the screenshots is not the place where they are being saved?

If you use relative paths for the screenshots in the test, then the setting for the path root is given in the preferences. If you are using a different workspace for the test exec run than you do for your ITE, then this could explain the difference. Bear in mind as well that screenshots are saved to the server machine.

I'm going to set the issue to "works for me", but please reopen it should you have more information.
Comment 2 Niklaus Giger CLA 2011-09-08 10:56:12 EDT
I am running testexec with no preferences at all. E.g. the call is
/opt/jubula_5.1.00156/jubula/testexec -project  ElexisDemo -port 60268 -version 1.0 -testsuite 'FULLTEST' -server localhost -autid elexis_linux -resultdir /opt/jubula-elexis/test-results -language  de_DE -dbscheme 'Default Embedded (H2)' -dburl 'jdbc:h2:/opt/jubula-elexis/test-ws/database/embedded;MVCC=TRUE;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE' -dbuser 'sa' -dbpw ''  -datadir /opt/jubula-elexis/test-data -data /opt/jubula-elexis/test-ws 

where /opt/jubula-elexis/test-ws, /opt/jubula-elexis/test-data  and /opt/jubula-elexis/test-results are empty directories.

For running repeatable tests I prefer to assume nothing at all and having preferences (stored in H2SQL) don't tick well with me. Is it really compulsary to have a Jubula installation on the slave?

I am running a Jenkins CI and delegate the whole job (e.g. Jubula Server & Client) to a Jenkins slave.
Comment 3 Alexandra Schladebeck CLA 2011-09-09 01:37:29 EDT
The -data argument is the path to the workspace (where the preferences are saved) for the test executor, as described here:

http://help.eclipse.org/indigo/topic/org.eclipse.jubula.client.ua.help/html/manual/node254.html

You should connect to this workspace from the ITE to make sure that your settings for the test results are correct for your test run.
Comment 4 Alexandra Schladebeck CLA 2011-09-09 04:24:59 EDT
I have just realised that I was getting my relative paths confused :) There is actually no preference in the workspace that defines the root path for screenshots - please excuse the confusion.

The screenshots are saved relative to the working directory if there is one, and to the server directory if there isn't. The gist is the same though, if the path to your screenshots is relative, then I assume they are just being saved to a different place. The point about the screenshots being saved on the machine where the AUT Agent runs was correct though.
Comment 5 Niklaus Giger CLA 2011-09-09 07:49:20 EDT
I solved the problem on my part by adding "--workingdir /path/to/dir" option to the autrun.

I remarked that by default the working dir of autrun is the installation path of jubula, which was marked as read-only on (most) of my systems. I think that this should be changed to either the current working dir or the path where the AUT is installed (the latter would correspond to the default setting when running the Jubula GUI).

Another problem was, that testexec refused to run (even when dbscheme, dburl, dbuser and dbpw were specified) unless it could find a db-connection in its preferences with the same name as given by dbscheme.

Taking into account these two limitations got my Jenkins CI setup into a working state and I can now proceed testing our application.

Thank you for help!
Comment 6 Alexandra Schladebeck CLA 2012-02-23 02:48:37 EST
As the problem has now been resolved, I am closing this ticket.