My first time to use Simple Data Writer, I have no idea how it works. So I figured it’s time to learn a new JMeter report (wink)
1. Add Simple Data Writer listener to my Google search script
2. Define its filename(where the generated result file will be saved) to:
3. Under “Log/Display” tick “Successes”
4. Run the test
I then opened google.log.txt in Open Office which is a comma delimited file and got this data:
Looks helpful right? Except for the timeStamp which I can’t decipher the format… yet 🙂
Anyway, rerunning my test scripts updates the log file and appends the new results at the end of the file. But what if you’d like to parameterized your report and include the current time in your log file everytime you execute your test?
JMeter can absolutely do this… since it supports certain Functions and Variables
One of which is the __time function which returns the current time in various formats:
- YMD = yyyyMMdd
- HMS = HHmmss
- YMDHMS = yyyyMMdd-HHmmss
- USER1 = whatever is in the Jmeter property time.USER1
- USER2 = whatever is in the Jmeter property time.USER2
From my current simple data writer listener, I edited its filename to:
With this configuration, Jmeter generates a new log file with the current date and time in yyyyMMdd-HHmmss format, everytime I run the test. With regards to the timeStamp details, I’m still on my way to find it.
Here’s my personal favorite:
* Software Testing: Where failure is always an option.
* Improving the world one bug at a time.
* Software Testing: You make it, we break it.
* Software Testers don’t break software; it’s broken when we get it.
* Software Testers: We break it because we care.
* If developers are so smart, why do testers have such job security?
* Life is too short for manual testing.
* Trust, But Verify.
* The Definition of an Upgrade: Take old bugs out, put new ones in.
* We break software so you don’t have to.
* I used to build software…now I break it! Its a lot more fun!!
* All code is guilty, until proven innocent.
* It’s Automation, Not Automagic!
* Quality Assurance, we take the blame so you don’t have to.
* In God we trust, and for everything else we test.
Pick yours in the list. =)
Gone tired of starting your selenium server by typing,
java -jar selenium-server.jar"
from your console or if you’re luckier create a batch file then run it to start your server
Here’s a more powerful tool to do it. Utilizing the selenium-client ruby gem, first you need to create a rakefile and define the tasks that you want to do. For instance we want to tell our rake to do the following tasks:
1. Start selenium server,
2. Stop selenium server, and
3. Restart selenium server
require ‘selenium/rake/tasks’ # use selenium rc rake tasks that are bundled with the selenium-client gem
SELENIUM_RC_JAR = Dir[File.dirname(__FILE__) + “/selenium-server*.jar”].first
# Start selenium server task
Selenium::Rake::RemoteControlStartTask.new(:’rc:start’) do |rc|
rc.port = 4444
rc.timeout_in_seconds = 3 * 60
rc.background = true
rc.wait_until_up_and_running = true
rc.jar_file = SELENIUM_RC_JAR
rc.additional_args << " -multiWindow -firefoxProfileTemplate FirefoxProfile" end # Stop selenium server task Selenium::Rake::RemoteControlStopTask.new(:'rc:stop') do |rc| rc.host = "localhost" rc.port = 4444 rc.timeout_in_seconds = 3 * 60 end # Restart selenium server task desc "Restart Selenium Remote Control" task :'rc:restart' do Rake::Task[:"rc:stop"].execute  rescue nil Rake::Task[:"rc:start"].execute  end [/sourcecode] In your console go to the root folder where your rake file is saved, type "rake -T" or "rake --task"
Console will list all available tasks defined in the rake:
rake rc:restart # Restart Selenium Remote Control
rake rc:start # Launch Selenium Remote Control
rake rc:stop # Stop Selenium Remote Control running
From this list you can restart/start/close the server by simply invoking the commands e.g. rake rc:start
Newbie in Ruby? Never heard Selenium? Had a reformat?
No sweat! Here’s a list of requirements to set up Selenium and Ruby in your Windows machine.
SELENIUM Remote-Control (RC )
- get it here
- extract the file anywhere in you local machine
–> Requirement to run the selenium server, should be 1.5 or later version
- get it here
- install Java and configure your PATH environment variable correctly.
- from the console, you can verify the installation by typing: java -version
SELENIUM RC RUBY CLIENT DRIVER
- requires Ruby
- recommended way to install: Ruby 1.8.6 One-Click Installer
- upgrade to latest version by getting the latest binary files of Ruby 1.8.7
- get the latest rubygem distribution as tgz or zip from here
- extract the archive to your desired directory
- 2 ways to install ruby:
from the console, go to the extracted directory then type: ruby setup.rb
from your explorer, go to the extracted directory and double click setup.rb file
- install the ruby client driver as a rubygem by typing: gem install <ruby gem>
gem install selenium-client
- install other gems that will be useful in your testing:
gem install rspec -v=1.2.6
gem install syntax
gem install faker
–> guide for all your rubygems documentations
- from the console type: gem install aptinio-bdoc
- then save the doc to your local, from the console type: bdoc //[path]
To get scripts or file from a repository through Git
- from the console, install github, bash or gui OpenInGitGui-2.0.zip
- generate an SSH rsa, type: $ ssh-keygen -t rsa
- copy the generated id_rsa pub
- paste it on the personal settings of ur public_key
- then clone