Hello all,
options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu')
dr = webdriver.Chrome(ChromeDriverManager().install(), options=options)
dr.get("url")
cWait = WebDriverWait(dr, 5)
usernameField = cWait.until(EC.presence_of_element_located((By.ID, "txtUserID")))
while running the above set of lines of code, when i click on pycharm run for this python file, it works in headless in good way but when I use terminal and write code something like
python main.py
the console gives this output
====== WebDriver manager ======
Current google-chrome version is 92.0.4515
Get LATEST driver version for 92.0.4515
Driver [C:\Users\bc62700\.wdm\drivers\chromedriver\win32\92.0.4515.107\chromedriver.exe] found in cache
DevTools listening on ws://127.0.0.1:53298/devtools/browser/b967343c-b07a-43a3-8d1f-d8b41e62e50d
[0906/071237.616:INFO:CONSOLE(19)] "Uncaught TypeError: Cannot read property 'txtUserID' of undefined", source: URL (19)
It is working absolutely fine with pycharm run button, but not with terminal please help as because of this reason I am not able to make this as schedular event.