I have to run browser automation remotely. This means when I execute scripts from machine A, application should open in the Chrome browser in Machine B and does the automation (navigating to few screens). For this scenario I have installed selenium jar file in Machine B and started the selenium server as a standalone. In the python script I have included the IP address of Machine B as command executor. I am trying to trigger this script from Machine A. But the chrome browser doesn't trigger in Machine B. When I try to execute to locally in Machine B itself it seems to be working. Could you please help me here?
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from time import sleep
capabilities = webdriver.DesiredCapabilities.CHROME.copy()
driver = webdriver.Remote(
command_executor="http://ip address of Machine B:4444",
desired_capabilities=capabilities
)
driver.get("https://www.google.com")
search_input_box = driver.find_element(By.NAME, "q")
search_input_box.send_keys("selenium webdriver" + Keys.ENTER)
sleep(3)
driver.quit()
I have to run browser automation remotely. This means when I execute scripts from machine A, application should open in the chrome browser in Machine B and does the automation(navigating to few screens).