Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: cant find webdriver logs inside node container #1575

Closed
i4ali opened this issue May 13, 2022 · 4 comments
Closed

[🐛 Bug]: cant find webdriver logs inside node container #1575

i4ali opened this issue May 13, 2022 · 4 comments

Comments

@i4ali
Copy link

i4ali commented May 13, 2022

What happened?

unable to find the chromedriver.log when using the dynamic grid using docker compose. I have docker exec into both the node container and the chrome container to find the file 'chromedriver.log' under / but its not there.

version: "3"
services:
  node-docker:
    image: selenium/node-docker:4.1.4-20220427
    volumes:
      - ./assets:/opt/selenium/assets
      - ./NodeDocker/config.toml:/opt/bin/config.toml
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  selenium-hub:
    image: selenium/hub:4.1.4-20220427
    container_name: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"

my config.toml is below

[docker]
configs = [
    "selenium/standalone-chrome:4.1.4-20220427", "{\"browserName\": \"chrome\"}"
    ]

url = "http://127.0.0.1:2375"
# Docker image used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20220427"

my client code is follows

profile = {"download.prompt_for_download": False,
                   "download.directory_upgrade": True,
                   "plugins.always_open_pdf_externally": True,
                   'safebrowsing.disable_download_protection': True,
                   'safebrowsing.enabled': False}
self.options.add_experimental_option("prefs", profile)
        self.options.set_capability('unhandledPromptBehavior', 'accept')
        self.options.add_argument("--disable-popup-blocking")
        self.options.add_argument("log-path=/chromedriver.log")
        self.options.add_argument('--disable-notifications')
        self.options.set_capability("se:screenResolution", "1920x1480")
        self.options.set_capability("se:recordVideo", "true")
        browser = webdriver.Remote(command_executor=self.remote_url, options=self.options,
                                       keep_alive=True)

Command used to start Selenium Grid with Docker

And running docker compose as follows

docker-compose -f docker-compose-v3-dynamic-grid.yml up

Relevant log output

node logs

23:00:48.036 INFO [DockerSessionFactory.apply] - Starting session for Capabilities {browserName: chrome, goog:chromeOptions: {args: [--disable-popup-blocking, --disable-notifications, --start-maximized, log-path=/chromedriver.log], extensions: [], prefs: {download.default_directory: /Users/Imran.Ali/Documents/..., download.directory_upgrade: true, download.prompt_for_download: false, plugins.always_open_pdf_externally: true, safebrowsing.disable_download_protection: true, safebrowsing.enabled: false}}, pageLoadStrategy: normal, se:screenResolution: 1920x1480, unhandledPromptBehavior: accept}

23:00:48.037 INFO [DockerSessionFactory.apply] - Creating container...

23:00:48.083 INFO [Container.<init>] - Created container 32c2c3d8d88c1d60d77c3dd8eab7f305bc04c44db2939260da7a05086f12f24d

23:00:48.083 INFO [Container.start] - Starting container 32c2c3d8d88c1d60d77c3dd8eab7f305bc04c44db2939260da7a05086f12f24d

23:00:48.475 INFO [Container.inspect] - Inspecting container 32c2c3d8d88c1d60d77c3dd8eab7f305bc04c44db2939260da7a05086f12f24d

23:00:48.482 INFO [DockerSessionFactory.apply] - Waiting for server to start (container id: 32c2c3d8d88c1d60d77c3dd8eab7f305bc04c44db2939260da7a05086f12f24d, url http://172.21.0.4:4444/wd/hub)

23:00:51.694 INFO [DockerSessionFactory.apply] - Server is ready (container id: 32c2c3d8d88c1d60d77c3dd8eab7f305bc04c44db2939260da7a05086f12f24d)

23:00:52.810 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C

23:00:52.830 INFO [LocalNode.newSession] - Session created by the Node. Id: 0782c62b044b8b38367b6d18a221086f, Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 101.0.4951.41, chrome: {chromedriverVersion: 101.0.4951.41 (93c720db8323..., userDataDir: /tmp/.com.google.Chrome.vZBQCx}, goog:chromeOptions: {debuggerAddress: localhost:44297}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdp: ws://172.21.0.4:4444/sessio..., se:cdpVersion: 101.0.4951.41, se:forwardCdp: ws://172.21.0.4:4444/sessio..., se:screenResolution: 1920x1480, se:vnc: ws://172.21.0.4:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.21.0.4:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: accept, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}

23:06:59.250 INFO [Container.stop] - Stopping container 32c2c3d8d88c1d60d77c3dd8eab7f305bc04c44db2939260da7a05086f12f24d

23:07:02.307 INFO [SessionSlot.stop] - Stopping session 0782c62b044b8b38367b6d18a221086f

Operating System

Mac OS Monterey 12.2.1

Docker Selenium version (tag)

4.1.4-20220427

@diemol
Copy link
Member

diemol commented May 16, 2022

Those logs are created inside the containers that are created during the dynamic execution. Also, ChromeDriver logs are aggregated together with Grid logs. However they are not collected and saved locally. What are you looking for?

@i4ali
Copy link
Author

i4ali commented May 17, 2022

whats the location of those logs in the dynamic containers? I docker exec into it while it was running but couldnt find it? I am looking for chromedriver logs for debugging purposes.

@diemol
Copy link
Member

diemol commented May 17, 2022

You would need to pause the execution to go inside the dynamic containers. As mentioned before, they are not sent to a special file, they are part of the docker logs which are also aggregating the Grid logs.

@diemol
Copy link
Member

diemol commented Jun 29, 2022

Dynamic Grid will save the log generated during the execution and it will be available on the mounted directory. However, cases like the one mentioned in this issue are out of the scope because the location is arbitrary. If you just let ChromeDriver output its log to stdout as normal, then it will be part of the saved log.

This will be available in 4.4, which should be released around the beginning of August.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants