Hana90
Hana90

Reputation: 925

Moving tests from windows to Linux server - Selenium

I have some tests, I am using

I run them on windows and all thing are going fine with successful run, I noticed that browser on windows is explicitly open and see the tests directly on browser.

Then I need to move this to run it on UBUNTU server, I just used Xvfb and try to run the tests. My notice:

  1. I can't see the graphical browser, I search for this thing and it is called a headless browser.
  2. I got different problems with tests, some of them couldn't have a successful test and others can't find some elements! although it is worked on Windows.

My questions, what are the main points we have to consider while moving our test from windows client environment to Linux server?

I am reading about headless browsers, could I have to use one of them? or Selenium can handle this issue.

What are changes in code have to consider to run tests on server? Or the same code should work fine on both environments?

Upvotes: 2

Views: 1544

Answers (1)

bhargav desai
bhargav desai

Reputation: 119

You can use PhantomJS (headless browser). It is better than HTMLUnit Driver. See this link for a better understanding. http://www.guru99.com/selenium-with-htmlunit-driver-phantomjs.html

You can download files for Linux from here http://phantomjs.org/download.html

Just like your Chrome or Firefox Drivers, you can use the PhantomJS (or htmlUnit Driver). They are specifically for OS systems that do not have a GUI or browser.

Upvotes: 0

Related Questions