I am using selenium server. Its working well to test an application running on port 80.
but if I test an application running on another port than 80, e.g. 5001, the connection is refused.
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities;
br = webdriver.Remote(command_executor="http://localhost:4444/wd/hub", desired_capabilities=DesiredCapabilities.CHROME)
br.get("http://127.0.0.1:5001/login/")
br.get_screenshot_as_file("/tmp/test.png")
I get the following screenshot:
How can I test on port 5001 ?
EDIT
I am running Selenium server as a Docker container with docker-compose:
version: '2'
services:
selenium:
image: selenium/standalone-chrome:latest
ports:
- 4444:4444