Answer a question

I have set up one Selenium Grid with one Hub in Ubuntu Server and one Node in Ubuntu Desktop. Installed Geckodriver and Firefox on the Node machine. And using the following python code.

from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions

options = webdriver.FirefoxOptions()
driver = webdriver.Remote(
    command_executor='http://192.168.56.7:4444/wd/hub',
    options=options
)

But getting error Error: no DISPLAY environment variable specified on the Node machine.

Working exactly fine after adding

options.add_argument('--headless')

Don't want to run it in headless mode.

Thanks to all in advance.

Answers

Just try to set environment variable DISPLAY please.

Your question is a bit duplicated with Selenium Error: no display specified

Logo

学AI,认准AI Studio!GPU算力,限时免费领,邀请好友解锁更多惊喜福利 >>>

更多推荐