# How to execute test cases inside browser-image

**URL:** <https://forum.robotframework.org/t/how-to-execute-test-cases-inside-browser-image/2172>\
**Category:** Browser\
**Created:** [23 July 2021 15:25 UTC](https://forum.robotframework.org/t/how-to-execute-test-cases-inside-browser-image/2172 "2021-07-23T15:25:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)\
**Post date:** [23 July 2021 15:25 UTC](https://forum.robotframework.org/t/how-to-execute-test-cases-inside-browser-image/2172/1 "2021-07-23T15:25:37Z")

</div>

Hi,

I create a docker image on top of `marketsquare/robotframework-browser:v6.0.0` docker image :

```python
FROM marketsquare/robotframework-browser:v6.0.0

USER root
WORKDIR /usr/src/app
RUN mkdir -m 755 logs

USER pwuser

COPY tasks/ ./tasks/
COPY libraries/ ./libraries/
COPY resources/ ./resources/
COPY variables/ ./variables/
COPY install/requirements.txt .

...

CMD robot --nostatusrc --outputdir logs -b debug.log tasks/*.robot \
    && cat logs/debug.log

```

I am having issue with write permissions on logs folder. When the image starts, I get a `PermissionDenied` error from robot claiming that it must not write the `output.xml`.

I already tried playing with users `root` and `pwuser` which I found in the original GItHub repository. But maybe my sources were outdated…

How can I create a folder and execute robot inside the image?

Regards,  
Markus

---

<div class="post-metadata">

**Author:** ![mikahanninen](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/mikahanninen/32/62_2.png) [@mikahanninen](https://forum.robotframework.org/u/mikahanninen)\
**Post date:** [26 July 2021 08:44 UTC](https://forum.robotframework.org/t/how-to-execute-test-cases-inside-browser-image/2172/2 "2021-07-26T08:44:59Z")

</div>

is that because you set permission 755… so I guess **root** has write permission to the logs but the **pwuser** has only read and execute permissions ?

---

<div class="post-metadata">

**Author:** ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)\
**Post date:** [26 July 2021 11:55 UTC](https://forum.robotframework.org/t/how-to-execute-test-cases-inside-browser-image/2172/3 "2021-07-26T11:55:39Z")

</div>

There is some kind of authorization mix between _root_ and _pwuser_. One is running with `python3` and `pip3`, the other on `python` and `pip`. Only 1 of them seems to have access to nodejs.

Anyway, it seems to be working like this, giving pwuser explicit ownership of the `WORKDIR`:

```python
FROM marketsquare/robotframework-browser:v6.0.0

USER root

WORKDIR /app
RUN mkdir logs \
    && chown -R pwuser:pwuser /app

USER pwuser
COPY tasks/ ./tasks/
COPY libraries/ ./libraries/
COPY resources/ ./resources/
COPY variables/ ./variables/
COPY install/requirements.txt .

RUN pip3 install -r requirements.txt

CMD robot --nostatusrc -d logs -b debug.log tasks/*.robot \
    && cat logs/debug.log

```

Like this, the tasks can be executed _inside_ the container and I can use the container also as execution environment in my GitLab pipeline:

```python
Validate syntax:
  stage: validate
  image: $CI_PROJECT_NAME:$CI_PIPELINE_ID
  script:
    - robot --dryrun tasks/*.robot

```
