Archive

Posts Tagged ‘report’

JMeter: Simple Data Writer + Current Date

September 15, 2009 5 comments

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:

D:\QA-Training\jakarta-jmeter-2.3.4\bin\reports\google.log.txt

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:

simple data writer report

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:

D:\QA-Training\jakarta-jmeter-2.3.4\bin\reports\google.log.${__time(YMDHMS)}.txt

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.

RSpec Reporting Tool

May 28, 2009 Leave a comment

Reports play a vital role in software testing. It provides results and more information which is the basis of our analysis and recommendations as software quality assurance.

Rspec gem provides an easy way of generating a report in our Selenium tests. Here are important things to remember:

1. Include the following commands in your spec file.

spec_helper

2. Create a method in your session that will rename your selenium driver instance to “selenium_driver”. (See lines 22-24)

selenium_driver

3. Run your spec in two ways:

Option 1: From the console, go to your spec folder and manually type below command right after you invoked “spec <spec_filename>.rb”

rspec command

e.g. spec user_spec.rb –require ‘rubygems,selenium/rspec/reporting/selenium_test_report_formatter’ –format=Selenium::RSpec::SeleniumTestReportFormatter:./reports/tests_report.html

where “user_spec.rb” is your spec filename

Option 2: Create a rake file  and require Rspec report formatter options, like the one below

rspec rakefile

From the console,

- go to the folder where you saved your rake file

- type rake -T or rake –tasks (this will display all the available tasks defined in your rakefile)

- invoked the task that will run your spec file by typing rake <task_name>, in my case ->> rake run:spec

Hint hint hint: Preferably intall ruby gem syntax to properly highlight the codes prior to running your tests.

And whalla! This setup will automatically generate an html report just like this everytime you run your spec files:

rspec report

Categories: selenium Tags: , , ,
Follow

Get every new post delivered to your Inbox.