硒找不到在单独容器中运行的文件 [英] Selenium cannot find file running in separate container

查看:73
本文介绍了硒找不到在单独容器中运行的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4个容器在同一个Docker网络中运行

I have 4 containers running in the same Docker network


  • mongodb

  • 我们的api服务器

  • 一个硒服务器

  • 我们自己测试

  • mongodb
  • our api server
  • a selenium server
  • our tests themselves

我从测试中得到此错误容器:

I get this error from our test container:

 WebDriverError: File not found: /root/cdt-tests/csv-data/IT-DE-Jasper.csv

但是,从我的测试日志来看,此文件完全存在...在测试容器中。

However, from my test logs, this file totally exists...in the test container.

我认为问题是硒服务器没有在与我们的测试容器相同的文件系统,因为它们运行在不同的容器中。

The problem, I think, is that the selenium server is not looking at the same filesystem as our test container, because they are running in different containers.

什么是最好的解决此问题的方法?

a。我应该尝试在同一个容器中运行它们吗?

a. Should I try to run them in the same container?

b。我可以以某种方式让他们共享同一文件系统吗?

b. Can I somehow get them to share the same filesystem?

c。 ?

推荐答案

仅仅因为您共享网络并不意味着您就共享了卷,请参见在Docker中,如何在容器之间共享文件,然后将其保存到图像?如@ alex-blex建议

Just because you are sharing the network doesn't mean you are sharing the volumes, see how to do that In Docker, how can I share files between containers and then save them to an image? as @alex-blex suggested

这篇关于硒找不到在单独容器中运行的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆