Python with Selenium issue Chrome is being controlled by automated test software

+1 vote

I have a small Python app that records a webpage/ web animation with Selenium and FFmpeg. This Worked until yesterday but it seems that the "--disable-infobars" feature has been removed. How can I overcome this because otherwise I am forced to add padding to the top and record from the padding?

Below is the sample code:-

#!/usr/bin/env python3
from pyvirtualdisplay import Display
import os

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options

url = "http://foo.bar"

os.environ['DISPLAY'] = ':99'
display = Display(visible=0, size=(1920, 1080))
display.start()
display_port = os.environ['DISPLAY']

chrome_driver_path = "/usr/local/bin/chromedriver"
options = webdriver.ChromeOptions()
options.add_argument('--disable-gpu')
options.add_argument('--kiosk')
options.add_argument('--window-position=0,0')
options.add_argument('--disable-infobars');
options.add_argument('--window-size=1920,1080')

browser = webdriver.Chrome(executable_path=chrome_driver_path, chrome_options=options)
browser.get(url)

command = "/home/fidox/bin/ffmpeg -r 60 -t {} -video_size {}x{} -framerate 60 -f x11grab -i foo.mp4 f-an {}".format(10,1920,1080,display_port)
os.system(command) 

self.browser.quit()
display.stop()
Mar 26, 2018 in Selenium by Shubham
• 13,490 points
15,803 views
Hi,

Did you able to resolve this issue yet ?
Hey @Anurag, have you tried the solutions proposed by @nsv999 and @manoj ? Didn't those work?

2 answers to this question.

0 votes

"disable-infobars" flag has been deprecated, but you can avoid this message by adding the following:

ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
options.setExperimentalOption("excludeSwitches",Collections.singletonList("enable-automation"));    
WebDriver driver = new ChromeDriver(options);

This work for me and I hope works for you too.

answered Mar 26, 2018 by nsv999
• 5,500 points
But your piece of code is for Java. Can you provide a solution for Selenium Python Webdriver?
you can simulate the mouse click using pyautogui.

try this , this should work.

time.sleep(10)
pyautogui.moveTo(1880, 140)
time.sleep(10)
pyautogui.click(1880, 140)

what this does is that it goes and clicks the close on the popup.
+1 vote
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("useAutomationExtension", False)
chrome_options.add_experimental_option("excludeSwitches",["enable-automation"])
driver = webdriver.Chrome(options=chrome_options,)
answered Apr 20, 2020 by Manoj
Python with Selenium issue     Chrome is being controlled by automated test software    | Edureka Community
[url=http://www.gt016qmme8805rp98am4d23n513x6dcms.org/]uexfmycgoj[/url]
<a href="http://www.gt016qmme8805rp98am4d23n513x6dcms.org/">aexfmycgoj</a>
exfmycgoj http://www.gt016qmme8805rp98am4d23n513x6dcms.org/

Related Questions In Selenium

+1 vote
1 answer

Disable notification" “Chrome is being controlled by automated test software” in ChromeDriver 2.36

"disable-infobars" flag has been deprecated, but you ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,500 points
17,196 views
0 votes
1 answer
+2 votes
1 answer

I want the console.log output from Chrome. I'm working with selenium on Python

So this is how you do it ...READ MORE

answered May 3, 2018 in Selenium by sniffy_god
• 780 points
41,758 views
+1 vote
1 answer

How to handle notifications in Python with Selenium (Chrome WebDriver)

Below will help you: You can disable the ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
14,374 views
0 votes
2 answers

Python: Using an existing google chrome profile with selenium chrome web driver

The problem is with the string "C:\Users\Eric\Desktop\beeline.txt" Here, \U starts an ...READ MORE

answered May 24, 2019 in Selenium by shinio llahsra
13,087 views
0 votes
1 answer

How can I write test scripts in Selenium with python?

Hey Khushi, writing test scripts in Selenium ...READ MORE

answered May 9, 2019 in Selenium by Anvi
• 14,150 points
882 views
0 votes
1 answer

How can we use Selenium with Python?

First  Install Python based on the Operating ...READ MORE

answered May 8, 2018 in Selenium by Meci Matt
• 9,460 points
872 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP