Robotframework-dashboard

Hello,
I have a question concerning Robotframework-Dashboard when run as a server.
I’ve tried uploading logs (log.html) using the API for “/add-log-file” and using robotframework-listener. But I can’t get neither to work.
Using the API I get either an error message that no comparable log.html or output.xml exists, or that it has been successfully uploaded to robot_logs/log.html - but when trying to access it, the dashboard tries to access log.html (without robot_logs).
Anyone has had any success using the log-upload of robotframework-dashboard?
I am using the currently latest version 1.8.1.
Thanks and regards

@timdegroot1996 is the author of rf dashboard, maybe he has some ideas ?

1 Like

Thanks @rasjani for the ping!

I think the issue you are having is that the log.html file you are uploading should match the path of an output.xml. Which means that if you have for example uploaded:

path/to/folder/output123.xml then the logfile should at least be in the same folder and with the same name like:path/to/folder/log123.html so it can find which output it corresponds to.

Can you check if that is indeed the case?

Thanks in advance,

Tim

Hi,
Thanks for the answer. I was already considering this and changed the names. Without success. Currently I believe it has something to do with my setup. I created a container with podman for robotframework-dashboard, pushed it to a registry and then created a gitops to pull this image and start the dashboard from there.
The containerfile just runs
FROM python:3.11-slim
RUN pip install robotframework-dashboard[server]
EXPOSE 8543
CMD ["robotdashboard"]
but the deployment.yaml on github then runs robotdashboard -s 0.0.0.0:8543 -d /data/dashboard.db -u. I’m not too sure if I was using absolute path. Will have to check in 12h :slight_smile:
I will have to check on the setup of the CI/CD pipeline, if the issue is there.
Regards.

Hi @TorSte,

Do let me know what happens and what you are trying to execute. If you want you can even include the API responses so I can debug or at least try to reproduce locally!

If you want to move this to an actual issue if you have problems that is also fine, but staying here and helping is also possible. (Issue can be made here if you need it: GitHub · Where software is built )

3 Likes

OK, the filenames really have to be absolutely unique. We were trying to save some disc space, by only keeping the last log of every run, but then the dashboard server would need to delete previous references to the same log in the db, so one didn’t misinterpret a previous run for the current run.
I obviously did not think this through. :blush:
Thanks for your patience.

p.s.
I needed to make some changes to robotdashboardlistener.py. Currently it is hardcoded to use http://.
As we are using https, (the server itself runs unencrypted, but during redirections it gets encrypted), I needed to remove all references to “http://” and instead changed self.host = host in the listener to:
self.host = "http://" + host if not host.startswith("http") else host

Regards,

1 Like

Hi @TorSte that does make sense indeed regarding the unique file names. If you have suggestions on how this could be improved for your usecase Im open to that. Maybe you can think of a smart way to remove logs or something? If you want you can make an issue for that.

Regarding https, that never occurred to me. So this is also something that we could make an issue for so people have this available!

1 Like

Tim, Maybe you can just use Protocol-Relative URLs as a nice easy fix?

1 Like

@TorSte, @damies13 To improve the usage here I’ve added a new PR that actually enables HTTPS usage in the server and the listener. Let me know what you guys think!

I had a look over it and it looks quite nice. Though I haven’t tested it yet.
What I have seen again is that with using robotdashboardlistener.py one can provide the path to output.xml and uploadlog=true and call it from robot.toml.
Is my understanding correct, that when uploading output.xml and log.html the first time, in the dashboard I can click on the link in the dashboard, the log.html will be opened. But when uploading output.xml and log.html a second time, the old log will be overwritten, the link on the first run in the dashboard now links to the new log but the link on the new run does not work? At least that was the experience I got, when using robotdashboardlistener. (I currently use separate calls to /add-output-file and /add-log-file with specially named outputXXX.xml and logXXX.html to prevent this). Or did I miss something?
Would it be a solution, to use the uploaded output.xml to create a new log.html (with a distinct name) and link this created logXXX.html to the correct entry in the db? Or to update the latest output.xml entry to the new log.html?
Regards and thanks for your work.

Glad to hear this is what you were looking for! Let’s see how it works once it’s released :slight_smile: .

Regarding the log files and opening them, I hope this documentation can clarify what it should do: Log Linking | RobotDashboard In short you are already on the right track and it should do what you describe.

  1. Whenever you upload output/log files you should name them uniquely so that every “run” in the dashboard will open their own individual log file.
  2. Achieving this by using robot’s --timestampoutputs is a very easy way since the listener will automatically pick up the timestamped files.
  3. Having the output/logs automatically “override” previous log files is intentionally not how it works, since then you could only look at 1 log file. Now with the unique names (as long as output/log name match, see also the docs), you can open the log file of every run in the dashboard. Giving you way more chances to find what the patterns are.

I hope that clarifies how the log linking should work, if something is still unclear let me know!