0

i have done a testcase on my windows system, now i need to run the same test case file into Ubuntu Linux server(without desktop).

From this Link tutorials, i supposed to install xvfb. Which i installed & tested. Its running successfully in my server.

Now my confusion is what is the next step? i.e what should i do in order to run the same testcase into my Linux machine? This test case is made with selenium (java) as Maven project on my local windows machine through eclipse

Dan
  • 2,086
  • 11
  • 71
  • 137
  • please anyone, help me. If you could not understand my question then just poke me . i will try to tell you in other way – Dan Feb 14 '14 at 09:13
  • What do you want to test? The behavior of your web application running on your linux box, called from a windows web browser? Actually xvfb is only required if you want to start a web brower in an headless environment. – Jcs Feb 14 '14 at 09:20
  • @Jcs I want to run a java test case file. I created a Junit file in eclipse it is build with selenium. It opens a firefox & perfomrs fome click on form to test. From eclipse, i used to run this file like "Rightclick on file" >> Select "run as Junit" . I want to run this same file in my ubuntu server. I have installed java, xvfb,selenuim into my server. – Dan Feb 14 '14 at 12:24

2 Answers2

0

For that purpose I used desktop Ubuntu, which contains all X.org dependencies. Also I installed XtightVNC for desktop. After that I added opening new screen using VNC server.

Finally I've installed Hudson (you may use Jenkins) and added env DISPLAY=:%monitorNumber% (e.g.: 2) to my start script. This command redirect execution to our VNC monitor.

I propose you to install X.org dependencies firstly, after that do what I did. But I don't remember exact steps how I setup, it was long long time ago.

InkStyle
  • 83
  • 1
  • 1
  • 6
  • I want to run a java test case file. I created a Junit test case file in eclipse it is build with selenium. It opens a firefox & perfomrs fome click on form to test. From eclipse, i used to run this file like "Rightclick on file" >> Select "run as Junit" . I want to run this same file in my ubuntu server. I have installed java, xvfb,selenuim into my server. – Dan Feb 14 '14 at 12:25
0

Quick and dirty

Install maven on the linux server and a JDK. Then copy the source code of your project to the linux server (e.g. clone the source repository or zip the directory and scp it). Run:

mvn clean test

A bit more complex but nicer

Using the Selenium Grid. The Grid allows selenium to start a browser from remote nodes.

First download the selenium server from the Google Code download page. Start the hub on your windows machine:

java -jar selenium-server-standalone-2.39.0.jar -role hub

Go to http://localhost:4444/grid/console to check that the hub has correctly started.

Then on the linux server start a node:

java -jar selenium-server-standalone-2.7.0.jar -role webdriver -hub http://<hub_ip_or_hostname>:4444/grid/register -port 5556 -browser browserName=firefox

In your test code, instantiate a RemoteWebDriver object with the Firefox capability. The remote webdriver object will automatically contact the hub to find a remote node with the requested capabilities (and here there is only one single node). Then the hub will forward the selenium commands to the remote node.

DesiredCapabilities capability = DesiredCapabilities.firefox();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
driver.go("http://www.myWebsiteToBeTested/");

Then you can add to the hub as many nodes as you wish, using different platforms and browsers (Firefox on Linux, IE on Windows, Safari on iOS...). The official documentation is here.

Jcs
  • 13,279
  • 5
  • 53
  • 70
  • Thanks for your time & reply. it may take 1 week to reply to your answer. Because my office is closed for few days from today. I accepted your answer without testing. I accepted because it sounds good & you spend your time for me. – Dan Feb 14 '14 at 18:44