I have only managed to execute tests with Google Chrome (using the chromedriver).
Can anyone give an example how to start executing tests with Chromium?
Make sure your Chromium binary can be located or set it explicitly.
Selenium::WebDriver::Chrome.path = '/usr/bin/chromium'
driver = Selenium::WebDriver.for :chrome
browser = Watir::Browser.new driver
I think it should be possible, you just have to provide path to Chromium. A few pages you should check:
http://code.google.com/p/selenium/wiki/ChromeDriver
http://watirwebdriver.com/chrome/
Use Selenium with Chromium Browser
Related
I have a problem with chromium when I run my tests through the puppeteer.
What happens is that my tests require the microphone to be enabled the moment I log in to the application, even after adding:
'--use-fake-ui-for-media-stream', '--no-sandbox', '--disable-setuid-sandbox'] : ['--use-fake-ui-for-media-stream'
Before working normally, after changing the machine it stopped working and I don't know if it is related to the version of the chromium that is started:
This is the version of chromium when testing starts:
Version 77.0.3844.0
And my version of the puppeteer is:
```"puppeteer": "^1.19.0"````
Has anyone ever experienced this? If so, how do I update the chromium?
Thanks,
Is there a way to use standard chrome instance instead of chromedrive.exe with selenium?
The chrome driver that is designed for selenium does not save cookies or browser state when being initialized.
For example, the installed instance of chrome is able to bypass 2-factor auth because it can remember that it is a known device in the remote system. On the other hand, the selenium chrome driver is unable to bypass 2-factor auth because it cannot remember its a known device.
I want to use the installed Google Chrome instead of the chromedriver.exe with selenium web driver. Can this be done?
You have to add, in the ChromeOptions the interested profile path.
Open your Chrome Browser and go to the chrome://version/ page.
And get the profile path.
For example, for me:
So, in Java:
String chromeDriver = "/pathTo/chromedriver";
System.setProperty("webdriver.chrome.driver", chromeDriver);
ChromeOptions options = new ChromeOptions();
String dir= "/Volumes/Macintosh HD/Users/DurdenP/Library/Application Support/Google/Chrome/";
options.addArguments("user-data-dir="+dir);
ChromeDriver driver = new ChromeDriver(options);
I like to run my karma unit tests on a headless chrome. Using karma-chrome-launcher and setting the browser to "ChromeHeadless" works on my machine. But on the CI server it fails with the message "No binary for ChromeHeadless browser on your platform."
Installing chrome on the CI machine is not possible. Is there another way to load the chrome binaries?
for example the google puppeteer module seems to load that when run. from the docs: "Puppeteer downloads and uses a specific version of Chromium". How can i achieve the same?
You can use Puppeteer (headless Chromium), follow these instructions.
If what you fear is that download from the internet might be slow, you can tell puppeteer where to download chrome from and use a local address.
Use PUPPETEER_DOWNLOAD_HOST to specify where to download Chrome from and PUPPETEER_SKIP_CHROMIUM_DOWNLOAD to skip downloading Chrome altogether.
You can read more about this in the documentation.
I'd like to set up Chrome in headless mode and the ChromeDriver for Selenium testing on my PythonAnywhere instance. I can't find any instructions on how to sort this out. Does anyone have any advice/pointers to docs please?
Meanwhile it works: you simply have to write an email to the PythonAnywhere support and they will enable it for your account (here are some details).
PythonAnywhere dev here -- unfortunately Chrome (headless or otherwise) doesn't work in our virtualization environment right now, so it won't work :-(
[edit] ...but now it does! See #Ralf Zosel's answer for more details.
I want to run some test using selenium standalone server on Google Chrome but i need to pass some ChromeOptions to the chrome driver from command line
Anybody has an idea of how can i do that?
Selenium Core, which is what you are referring to, was released before Chrome existed. Support for Chrome was added later. What you are asking for was never supported, and with Selenium Core deprecated several years back, it will probably never be supported.
One possible workaround is to set the desired options in the Chrome profile.
Another options, although much more painful, is to move up to Selenium WebDriver.