3

As can be seen from the title, I am trying to run Katalon Studio in a Docker Linux container in Azure. Perhaps I’m trying a tad too much regarding integration. I integrated Docker into Azure and copied my whole Katalon project into the container through git clone from a git repository. It seems to be working, since I can run docker commands in the container and see the files in the container using ls. However, when I try to run a test suite which is located in the container, I keep getting an error.

The command I run is

docker run -t --rm -v /home/docker/katalontest:/katalon/katalon/source katalonstudio/katalon katalon-execute.sh -browserType=“Chrome” -retry=0 -statusDelay=15 -testSuitePath=“Test Suites/Test”

The error I get is as follows:

echo 'Starting Katalon Studio'
Starting Katalon Studio
cat /katalon/version Google Chrome 72.0.3626.109 Mozilla Firefox 65.0 Katalon Studio 5.10.1
pwd
current_dir=/
workspace_dir=/tmp/katalon_execute/workspace
mkdir -p /tmp/katalon_execute/workspace
chmod -R 777 /tmp/katalon_execute/workspace
source_dir=/katalon/katalon/source
'[' -d /katalon/katalon/source ']'
project_dir=/tmp/katalon_execute/project
mkdir -p /tmp/katalon_execute/project
cp -r /katalon/katalon/source/Reports /katalon/katalon/source/report /tmp/katalon_execute/project
touch /tmp/katalon_execute/project/.classpath
chmod -R 777 /tmp/katalon_execute/project
rm -rf /tmp/katalon_execute/project/bin
rm -rf /tmp/katalon_execute/project/Libs
ls -la /tmp/katalon_execute/project total 16 drwxrwxrwx 4 root root 4096 Feb 19 07:33 . drwxr-xr-x 4 root root 4096 Feb 19 07:33 ..
-rwxrwxrwx 1 root root    0 Feb 19 07:33 .classpath drwxrwxrwx 2 root root 4096 Feb 19 07:33 Reports drwxrwxrwx 2 root root 4096 Feb 19 07:33 report
report_dir=/katalon/katalon/report
'[' -d /katalon/katalon/report ']'
mkdir -p /katalon/katalon/report
args=("$KATALON_KATALON_INSTALL_DIR/katalon" "$@")
args+=("-runMode=console")
args+=("-reportFolder=$report_dir")
args+=("-projectPath=$project_dir")
cd /tmp/katalon_execute/workspace
xvfb-run -s '-screen 0 1024x768x24' /opt/katalonstudio/katalon -testSuitePath=Test Suites/Test -g_Pass=smartlink2test -runMode=console -reportFolder=/katalon/katalon/report -projectPath=/tmp/katalon_execute/project Opening project file: /tmp/katalon_execute/project Invalid argument: Cannot find project'/tmp/katalon_execute/project'. 
Request sent successfully.
ret_code=4
id -u
id -g
chown -R 0:0 /katalon/katalon/report
chmod -R 777 /katalon/katalon/report
ls /katalon/katalon/report
cd /
exit 4

It seems the project can’t be found. I can’t figure out why. Any help would be greatly appreciated.

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
Vydai
  • 55
  • 6

1 Answers1

1

You are right you are able to execute commands inside the container because you (clone/mount (-v /home/docker/katalontest:/katalon/katalon/source katalonstudio/katalon) the Katalon executables.

However, your issue is that your project when cloning the repo it is still inside the repository (https://github.com/katalon-studio/docker-images/tree/master/test/project - which in your case it is here (/katalon/katalon/source katalonstudio/katalon) however, you are forcing Katalon to use another location which is: -projectPath=/tmp/katalon_execute/project

Either you pass the right -projectPath or you clone/mount the repository there.

Also, I would suggest you to pay a bit more attention to the documentation.

Sergiu
  • 2,928
  • 3
  • 27
  • 37
  • Do you mean the docker documentation? I really couldn't find something relatable to this issue which would help me advance. How would I go about passing the right _-projectPath_? This is configured into the katalonstudio/katalon docker image I thought. – Vydai Feb 19 '19 at 10:29
  • No, I wasn't referring to the Docker docs but to Katalon Docs (https://github.com/katalon-studio/docker-images). When you execute the Docker run command you will have to specify: -projectPath and the directory where your project is, as explained here: https://github.com/katalon-studio/docker-images#usage – Sergiu Feb 19 '19 at 16:59
  • I have basically the exact same command, but then adapted to the directory inside the container in which I cloned my project. Where would it be going wrong then? – Vydai Feb 20 '19 at 07:47
  • Can anyone please explain it with an example or command. I am confused – deepti mullur Sep 03 '19 at 14:19