I would like to run my selenium scripts on the cloud/online/remotely. I have been advised google compute engine could allow this.
It would be appreciated if this could be confirmed and additional steps that will be needed to be given too.
Any other solutions suggested would be appreciated.
The only difference is that your GCE instance doesn't have a display, which is going to be an issue for your browser.
To address this, you'll want to run Selenium using a "Virtual Framebuffer". This is basically a "Fake display".
Here's how you set a Virtual Framebuffer up in Ubuntu:
sudo apt-get install xvfb
sudo Xvfb :10 -ac
Then, before starting your selenium script, just run:
export DISPLAY=:10
Related
(solved, make sure your graphics driver is correct, dont remember which, its from between fake and legacy. Otherwise, reinstall your os, it should fix then)
Also, thanks to: Anston Sorensen, for trying to help
Question:
When I launch Minecraft pi it shows a black window for a second and closes.
in command line it gives me the error:
failed to add service - already in use?
after command:
sudo minecraft-pi
Try this:
sudo apt-get purge minecraft-pi
sudo apt-get update
sudo apt-get install minecraft-pi
If all else fails why not just play the full version of Minecraft? (Minecraft Java Edition). https://forums.raspberrypi.com/viewtopic.php?t=279135
I'm using playwright to run automated testing on CentOS 8.
Node script are run as systemd services.
Chromium is used from the rpm package.
But chromium from rpm package has problems with video codec support.
I installed chromium from flatpak and tried to run it...
After the first failure, I went to github playwright repo.
Then I created another question, but already in the flatpack repo.
In short, when I try to start chromium from flatpak from script that is running as a systemd service, I get an error:
Cannot autolaunch D-Bus without X11 $DISPLAY
(zenity:8): Gtk-WARNING **: 17:13:28.767: cannot open display:
As far as I understand, I need to somehow make sure that the script running as a service has a dbus... How to do it?
You need to set correct Environment= inside your unit or export all required variables using
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
See
https://unix.stackexchange.com/a/653101
https://wiki.archlinux.org/title/systemd/User#Environment_variables
After that, even with a basic unit below
~/.config/systemd/user/chromium.service
[Unit]
Description=Chromium
[Service]
ExecStart=/usr/bin/flatpak run org.chromium.Chromium
ExecStop=/usr/bin/flatpak kill org.chromium.Chromium
[Install]
WantedBy=default.target
systemctl --user start chromium will open your browser
https://prnt.sc/hlt4ey
I'm trying to get onto the xfce4 client from my chromebook (and it has worked before), however now this error is popping up. How do I fix this error?
My guess is you may not have the right user privileges. According to the error message you provided you are running an Ubuntu Linux environment.
If you haven't tried running the program through the terminal yet, attempt to do so.
The terminal can typically be opened by the key combination Ctrl+Alt+T on ubuntu linux.
Try using sudo command before running the program. This will run the command you enter using root privileges.
For example, if running the program on your terminal is
myName#ubuntu: xfce4
And this encounters an error, try to use sudo beforehand like so:
myName#ubuntu: sudo xfce4
Alternatively you can log in and not have to type sudo before every command.
myName#ubuntu: sudo bash
password:
If this fails you may need to update the package that contains the library. This can be done on the terminal in a fashion similar to:
myName#ubuntu: sudo apt-get install --only-upgrade xfce4
I installed Chromium 59.0, and I'm trying to run it in headless mode using the following command:
sudo /opt/google/chrome/chrome --headless --disable-gpu --no-sandbox
but I'm getting the following errors:
[0512/174717.638937:WARNING:audio_manager.cc(295)] Multiple instances of AudioManager detected
[0512/174717.639027:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected
Has anyone encountered this and found a way to get past it?
I encountered the exact same thing under dockerized ubuntu running karma.js tests.
You will need to have pulseaudio or similar running.
Try:
apt-get install pulseaudio
And before you run chrome
pulseaudio --daemonize
You can see it in my docker-entrypoint.sh:
https://github.com/codeclou/docker-nodejs-chrome-xvfb
When running with docker you will need to run docker with:
--shm-size=128M
Since chrome will complain about small /dev/shm which is 64MB by default.
I use Ubuntu 16.10. I tried installing Selenium module of python via the command - sudo pip3 install -U selenium. But, I am not able to install it. It is giving an unexpected error. I am sharing the screenshot of the terminal here. Please help!
Please click here for the screenshot
If you are using Ubuntu, I'd suggest checking in the package manager as it may already be there. I'm on Mint and it was already there when I loaded python (2.7 also).