user2985043
user2985043

Reputation: 85

Is it possible to run selenium scripts using google compute engine?

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.

Upvotes: 4

Views: 2885

Answers (1)

Thomas Orozco
Thomas Orozco

Reputation: 55283

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

Upvotes: 9

Related Questions