Selenium works with Firefox, but not with Chrome

Asked

Viewed 359 times

1

I was normally using Firefox on Selenium with Python, but I wanted to do some testing using Google Chrome, so I made the following change:

self.driver = webdriver.Firefox()

To

self.driver = webdriver.Chrome()

It opens Google Chrome but soon after it closes and appears this message at the prompt:

[6552:2280:1116/091247.001:ERROR:audio_manager_base.cc(275)] Invalid audio output Parameters Received; using fake audio path. Channels: 0, Sample Rate: 0, Bits Per Sample: 0, Frames Per Buffer: 0

As in my tests I will not use any audio, I tried to look for something to disable, but only found as 'mute' and even with this option the error was the same.

I thought I’d run something through the constructor to disable the audio, but there’s nothing for that:

def __init__(self, executable_path="chromedriver", port=0,
                 chrome_options=None, service_args=None,
                 desired_capabilities=None, service_log_path=None)

And the message does not say where this file 'audio_manager_base.cc' comes from, I searched the Chrome folder in the python folder and nothing.

The drive I’m using is the latest and Google Chrome too.

Note: The log file that is generated by the drive is empty.

Update

During my research I saw that this audio error happened not only in Selenium, so I suspected, this error happens because the P2 plugin of the computer is without anything there, simple like that, but it still doesn’t work, I was putting a pause on each line to check why Chrome closed, so I found that it is on the line where it makes the screenshot, the weirdest that it shows no error:

qr = self.driver.find_element_by_css_selector(self._SELECTORS['qrCode'])
qr.screenshot(self.username+".png")

Update

I made a change in the code, now it takes the screenshot but only from the whole screen, I need to take only one element, but with that I was able to continue a little bit the flow of the code, and I discovered another problem, when running a script:

Store = driver.execute_script(script)

Displays the following error when trying to run the script:

Webdriverexception: Message: Unknown error: Maximum call stack size exceeded

The problem that it fails to catch a very large return object from the script.

I’m coming to the following conclusion, that the drive to Google Chrome is very limited compared to firefox, the code works very well in firefox, but in Chrome happen these problems, in all my research I realized that the problem is really drive limitation, but still I am hopeful of this mistaken, so I continue with this question here.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.