I have started a hub and a node on the same machine using the following commands:
xvfb-run -a java -Dwebdriver.chrome.driver=/usr/bin/chromedriver -jar selenium-server-standalone.jar -role hub
xvfb-run -a java -Dwebdriver.chrome.driver=/usr/bin/chromedriver -jar selenium-server-standalone.jar -port 7777 -role node -hub http://192.168.111.253:4444/grid/register -browser browserName="chrome",version=ANY,platform=LINUX,maxInstances=5
I am trying to instantiate a browser windows using the following code:
options = webdriver.ChromeOptions()
options.add_argument("no-sandbox")
options.add_argument("--disable-gpu")
options.add_argument("--window-size=800,600")
options.add_argument("--disable-dev-shm-usage")
browser = webdriver.Remote(
command_executor=f"http://192.168.111.253:4444/wd/hub",
options=options
)
browser.get(r"https://www.google.com")
The page is getting fetched successfully and I can see the HTML code of the page using browser.page_source but the Chrome window doesn't open on the node. I haven't specified the headless option at all. I am using version 95 of Chrome and Chromedriver.
Please note that I am running the code on a jupyter notebook hosted on the same machine which acts as the selenium server and node. I am accessing the notebook from another computer on the same LAN.
Any help would be appreciated. Thank you.