Posts

Showing posts with the label testing

Apache Benchmark for load testing

Apache Bench is a great load testing tool for web servers Here are the following steps 1. Install Apache Bench sudo aptitude install apache2-utils 2. Run Apache Bench The following line uses keepalive for 10,000 connections, at a concurrency of 100 and a timeout of 20 seconds. Be sure to end root domains with a slash. ab -k -n 10000 -c 100 -t 20 http://yourwebsite.com/

Execute JavaScript + Capybara

There are certain cases where we need some custom JavaScript while writing some Integration test cases. For such cases you can use page.execute_script. For Example page.execute_script("$('#blog-hover-#{blog.id}').show();")

Browser Testing from Rails console using Capybara and selenium

To begin with you need to install the Capybara gem gem install capybara Once the gem is installed you can follow the below mentioned procedure. nishant@Nishant-Lap:~/Desktop/capybara$ rails c   Loading development environment (Rails 3.2.13) 1.9.3p392 :001 > require 'capybara/dsl' => true 1.9.3p392 :002 > include Capybara::DSL => Object 1.9.3p392 :003 > Capybara.default_driver = :selenium => :selenium 1.9.3p392 :004 > visit "http://google.com" => "" 1.9.3p392 :005 > page.fill_in('q', :with => 'nishant nigam')