Running Selenium Tests through Linux Server - linux

This is a general question, but I want to run my Selenium tests on a cloud Linux Server. I am accessing this server using PuTTY, which is just a terminal.
I was wondering how I could get my Selenium scripts to run on this VM.
Currently I have a Selenium Grid set up with physical machines, I just do not know how to set one up through a server where the only communication I have with it is through PuTTY and a terminal.

To run Selenium from a Linux server that is "terminal only", as you put it, is to install a GUI inside of the server.
The most common GUI to use, is Xvfb. There are plenty of tutorials out there on how to run GUI programs like Google Chrome and Mozilla Firefox through Xvfb.

You can also use PhantomJS to do a headless Automation, that doesn't need any GUI installation on Server.

Related

How do I run Internet Explorer on a Windows computer from a Linux VM based on the same computer?

I'm working on a Linux virtual machine on a Windows computer and doing tests on a website using RobotFramework. I would like to open the Internet Explorer browser on this windows computer from my Linux RobotFramework script.
Do you know a way to do this? Thank you.
Previously, I already tried to use Grid Selenium but that did not suit me because the option "timeout" of "open browser" did not work under ExetendedSelenium2library.
The Internet Explorer on your Windows machine hosting the Linux VM is a Windows-compatible binary, so cannot be executed natively under Linux. You can execute Windows-compatible binaries via Wine however, but compatibility is not very good. It's much more common to run Windows in a virtual machine in order to run Internet Explorer, not the other way around.

Can I run a Puppeteer.js scraper on a Windows Server without docker?

I have absolutely no experience using docker, but I'm trying to build a robust website scraper using Puppeteer.
Can I run it in a Windows Server 2003 environment running SQL Server 2008 R2 without having to go back and keep tweaking it later?
If yes, then how? Just as I would in a normal Node environment (i.e. NPM)?
I personally have no experience running puppeteer on windows, but I think you can do it connecting to a "remote instance of chromium" (in the same machine), the "browser" that launched puppeteer, this is the thing that have problems working in windows.
You can follow this examples to make this connection.
https://www.sitepen.com/blog/2017/10/04/browser-automation-with-puppeteer/
https://blog.rnsloan.com/2017/10/27/puppeteer-windows/
Let me know if this works.

How to configure headless browser using protractor on windows so that it can be run using team city without any GUI resolution issues?

How to configure headless browser using protractor on windows so that it can be run using team city without any GUI resolution issues?
Currently I am using chrome browser to run my UI automation test but at some page I am facing element not found issue due to resolution issue.
So I wanted to go for an headless browser.
Thanks.
Phantomjs is officially discontinued, so you must use headless Chrome. As for the instructions on how to set it up, follow instructions
Getting started with headless chrome can be found here

Xserver on Windows7

I have been using X11 with windows Maker provided with cygwin package for multi windows in windows Xp. Currently I am moving to windows 7 but unable to install cygwin.
Is there any other multi windowing system like windows maker for cygwin on windows ?
Thanks for your help in advance.
~ JJA
I really like to use MobaXterm as nice ssh client, but more importantly as very lightweight and fast X server for Windows.
Typical usage on Windows: start MobaXterm, then from its console ssh user#linux-box. Now, you can simply execute any GUI program on your Linux box, like gedit, eclipse, etc., and it simply works! This is because MobaXterm automatically supports forwarding of you graphical DISPLAY from Linux to Windows.
This method for remote access works much faster than VNC. Performance is actually similar to Remote Desktop, if not even faster.

Is it possible to run Magento TAF (Test Automation Framework) on Linux?

I'm trying to configure Magento TAF on Ubuntu, following the Installation Guide pdf.
I read on it...
Current version limitations:
Remote tests executing
UNIX running Usage
Firefox profile through configuration file
...but I feel skeptical :)
There is a main shell script prepared (runtests.sh)
if I configure everything and I execute selenium RC and runtests.sh, firefox browser opens... (but stands on empty page).
Furthermore: there are several inconsistences on the Installation Guide, that's why I suspect that Linux restrictions perhaps are deprecated. For example: on page 2 says...
At the base level, Magento Test Automation Framework will require the
following software: (...)Selenium RC 2.0.3
... but on page 4...
Download and install Selenium RC 1.0.3 (...).The latest available
version is 2.x, Download Selenium RC (Now available NEW 2.0b), but
automated test cases will probably not work with it.
The question: Is it possible to run Magento TAF on Linux?
Thanks!
Yes, it is possible.
I had the same problem using Selenium Grid in version 1.x.
Download Selenium Driver (Selenium 2). I got the tests running in Debian without modifying runtests.sh.
If you plan to test with several OS / browsers you can find a quick start tutorial for Selenium Grid 2. This may be helpful if you host your Magento code on a linux webserver. It's much easier now to set up the grid than it was with Selenium 1, fortunately.
Launch the server with
java -jar selenium-server-standalone-2.15.0.jar -role hub
By default, the server will run on port 4444. You can start the server on a Linux box without a desktop environment (e.g. a development web server).
Then you set up boxes with desktop environment (e.g. a Windows machine and a Linux machine). Now you download the server standalone library for every machine and start the client:
java -jar selenium-server-standalone-2.15.0.jar -role node -hub http://192.168.1.2:4444/grid/register
You have to change the IP to the IP of your Selenium server (and change the port if you did so in the first command). By default, the client will run on port 5555. If you want to use another port for the client or if you wish to start several client instances, you can define custom ports using the -port switch.
Note: don't care too much about the software versions mentioned in the document at all. It seems to be a bit outdated.
The latest public release works fine on Ubuntu/Debian pretty much out of the box, but the documentation is Windows-orientated.
We got the tests running on a headless Selenium installation using Google Chrome on Ubuntu server 11.04 64bit. Screen-shots are only possible when using Firefox, but Selenium requires version 3.6 of Firefox, so we'll need to downgrade the Mozilla browser to enable that.
[Update: March 27th 2012] We tried again with Firefox 10 after upgrading our packages and to our biggest surprise, it worked! We've now got screen-shots!
I wrote a tutorial (updated March 27th 2012) that outlines installing a fresh headless Selenium environment with Magento TAF on Ubuntu Server. Hope that helps.
Yes, this is possible.
I made a init script selenium-headless that simplifies running the TAF on a server.
The TAF project is under development, this is just a preview was published. The team wanted to share ideas and give valuable benefits (automatic tests) for everyone, who is developing for Magento. TAF will have changes, it will be restructured and polished before the official release.
The docs are outdated a little, they give general overview of the tests usage. Currently TAF can be run on both Windows and Linux, and both Selenium 1 and 2 can be used to run them.
Summary
Yes, TAF can be run on Linux.
Do not mind documentation inconsistences
If tests do not run - re-check your configuration and Selenium installation.
P.S. And sorry for issues - this version is just a working draft. It will be improved, documentation will be proof-read and informative messages will be provided.
Thanks for using TAF, anyway :)

Resources