Selenium可以在CircleCi环境中按域名访问Web服务器
在CircleCi配置中,我将my-Domain
添加到etc/hosts
按订单中,以通过域名访问本地WebServer。
例如=> http:// my-domain:3000/some-endpoint
,但是当我使用以下config.yml开始硒测试时,我只能调用http://127.0.0.0.0.1:3000/ some-endpoint
和http:// localhost:3000/some-endpoint
selenium。
当我尝试使用http:// my-domain:3000/some-endpoint
selenium时,它给了我org.openqa.selenium.nosuchelementException
steps:
- checkout
- run:
name: Add my-domain in etc/hosts
command: |
echo '127.0.0.1 my-domain' | sudo tee -a /etc/hosts
cat /etc/hosts
- run:
name: Start server for testing
command: |
cd ${DIR}
. venv/bin/activate
python3 server.py
background: true
- run:
name: Start Testing
command: ./gradlew test --stacktrace
In CircleCi config, I added my-domain
to etc/hosts
in-order to access local webserver by domain name.
For example => http://my-domain:3000/some-endpoint
But when I start Selenium-testing using the following config.yml, I can only call http://127.0.0.1:3000/some-endpoint
and http://localhost:3000/some-endpoint
from Selenium.
When I try to use http://my-domain:3000/some-endpoint
from the Selenium, it gave me org.openqa.selenium.NoSuchElementException
steps:
- checkout
- run:
name: Add my-domain in etc/hosts
command: |
echo '127.0.0.1 my-domain' | sudo tee -a /etc/hosts
cat /etc/hosts
- run:
name: Start server for testing
command: |
cd ${DIR}
. venv/bin/activate
python3 server.py
background: true
- run:
name: Start Testing
command: ./gradlew test --stacktrace
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论