Thursday, June 25, 2015

how to Capybara


  • sudo apt-get update

sudo apt-get install xvfb
sudo apt-get install x11-xkb-utils
sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
sudo Xvfb :10 -ac

java -version
sudo apt-get install default-jre


The answer is simple, use nohup command line-utility which allows to run command/process or shell script that can continue running in the background after you log out from a shell:
The syntax is as follows
nohup command-name &


testing your Ruby code with Rspec,
We’re going to look at how to can use Rspec to do TDD in Ruby.
Rspec is one of the best frameworks for testing in Ruby,


Selenium is a automated web testing framework
Selenium IDE which is just record and replay macro
 It is very limited in functionality and does not scale well if you want to deploy in multiple servers.
 Selenium WebDriver which is flexible and let you run selenium headless in servers with no display.

 If you want to create some robust process automation which needs to run 24X7 and you need reliability, then your only choice is to have Selenium in a server. But in order to run, Selenium needs to launch a browser. If there are no display to the machine, the browsers are not launched. So in order to use selenium, you need to fake a display and let selenium and the browser thinks they are running in a machine with a display.

 configuring and running selenium headless in Ubuntu using Mozilla Firefox as our primary browser


 JavaScript Testing with Selenium & Capybara-Webkit
 By default Capybara uses Rack::Test which is a headless browser emulator
 If you need to test JS as part of your integration suite, then you need to use another driver.

 you’ll need to set up xvfb in order to use either Selenium or Capybara-Webkit
 Now selunium and capybara-webkit will use xvfb when launching a browser.

 There are alternative x-servers and alternative ways to use the x-server from the specs (headless gem)
 It’s possible to use Chrome or another WebKit-based browser

 http://tutorials.jumpstartlab.com/topics/capybara/capybara_with_selenium_and_webkit.html

No comments:

Post a Comment