Marlabs Test Digest April 2014

1,139 views

Published on

Achieving Quality goals !!
How do we continuously improve software testing projects ? Few ideas would include - “Automate wherever possible”. Automation brings in efficiency, standardization apart from quality benefits. The focus needs to be on identifying opportunities to automate the entire Testing life cycle, not just the test execution. “Reuse” of knowledge, artifacts, frameworks helps to increase productivity, gain a head-start
in executing projects and focus on other value adds. “Enhance” existing tools and frameworks- customize them to your specific situation, integrate different tools to get the best of both features, leverage features of tools e.g. use of
QC Open Test Architecture API to enhance, integrate
and customize QC capabilities. Some of your significant
enhancements can even end up contributing back to open source projects. Track and share Test metrics- operational
& strategic and work on improving project parameters. What are the innovative practices in your project? We would be happy to hear from you and learn from your best practices.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,139
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Marlabs Test Digest April 2014

  1. 1. APRIL 2014VOLUME 1.8 MARLABS NEW SLETTER FOR TESTING UPDATES A ND KNOW LEDGE SHARING Editorial … Achieving Quality goals !! How do we continuously improve soft- ware testing projects ? Few ideas would in- clude - “Automate wherever possible”. Automation brings in efficiency, standardization apart from quality benefits. The focus needs to be on identifying opportunities to automate the entire Testing life cycle, not just the test execution. “Reuse” of knowledge, artifacts, frame- works helps to increase productivity, gain a head-start in executing projects and fo- cus on other value adds. “Enhance” existing tools and frameworks- customize them to your specific situation, integrate different tools to get the best of both features, leverage features of tools e.g. use of QC Open Test Architecture API to enhance, integrate and customize QC capabili- ties. Some of your signifi- cant enhancements can even end up contributing back to open source projects. Track and share Test metrics- op- erational & strategic and work on improving project parameters. What are the in- novative practices in your project? We would be happy to hear from you and learn from your best practices.  SELENIUM INTEGRATION WITH JMETER............ 2  GOOGLE GLASS ......... 5 Happy Reading!!
  2. 2. Selenium Integration with JMeter -- by Vijayakumar Rangaiah Functional test scripts are the first scripts created while automating an application in any web based project. Func- tional Automation is taken up earlier while performance testing is done towards end of the project. Functional test scripts can be used for performance testing, when the functional test scripts are created in Selenium with JUnit frame work. The objective of this article is to demonstrate Selenium Functional scripts in JMeter Performance testing. Selenium can be used for below shown components to automation JUnit is one of the powerful frameworks. JUnit is a Java tool that allows you to easily write tests through using uses Annota- tions and Reflection JUnit can be used for the following types of tests :  Functional tests  Integration tests  Acceptance tests  Stress tests JUnit is a tool for Test Driven Development. Below is the typical approach of TDD using JUnit framework. Here we are using Eclipse IDE for building our functional [ONE SCRIPT FOR FUNC TIONAL & PERFORMANCE T ESTING] T E S T D I G E S T © 2 0 1 4 M A R L A B S S O F T W A R E P V T L T D P A G E 2
  3. 3. test script in JUnit4 Selenium WebDriver. Now let’s focus on build our functional test script in Junit4 using Selenium Webdriver. Example code is built in Eclipse IDE, import Selenium jar & compile to source code. import java.util.concurrent.TimeUnit; import org.junit.*; import static org.junit.Assert.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; public class JMeter { private WebDriver driver; private String baseUrl; private StringBuffer verificationErrors = new StringBuffer(); @Before public void setUp() throws Exception { driver = new FirefoxDriver(); baseUrl = "https://www.google.co.in"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void testJMeter() throws Exception { driver.get(baseUrl + "/"); driver.findElement(By.id("gbqfq")).clear(); driver.findElement(By.id("gbqfq")).sendKeys("JMeter"); driver.findElement(By.cssSelector("em")).click(); driver.findElement(By.cssSelector("font > strong")).click(); try { assertEquals("Apache JMeter - Apache JMeter™", driver.getTitle()); } catch (Error e) { verificationErrors.append(e.toString()); } } @After public void tearDown() throws Exception { driver.quit(); String verificationErrorString = verificationErrors.toString(); if (!"".equals(verificationErrorString)) { fail(verificationErrorString); } } } T E S T D I G E S T © 2 0 1 4 M A R L A B S S O F T W A R E P V T L T D P A G E 3
  4. 4. Functionality of the above test script: 1). Google application is searched for JMeter text. 2). JMeter link is clicked & verify the landing page title for ‘Apache JMeter - Apache JMeter’. This functional script can be used for testing the functional flow of an application across browsers for single instance & make sure application works functional. Suppose we need to test the same scenario for n number of users & generate load on sever to ana- lyze server behavior. Then our same functional script built using JUnit with Selenium webdriver can be used in JMeter tool to generate the load. Here are the steps for porting Selenium functional scripts in JMeter performance test. Step 1: Export the Java ‘Test Project’ & create JAR file of the project. (Right click on ‘Test Project’ –> Export –> Java –> JAR File –> Finish ) Step 2: Copy & paste the ‘Test.jar’ file in the lib folder of JUnit location Example: ‘D:apache-jmeter-2.7libjunit’ & ‘selenium-server-standalone-2.24.1’ server file in the location lib folder Ex: ‘D:apache-jmeter-2.7lib’ Step 3: Open the JMeter tool by executing ‘jmeter.bat’ file. Create a Thread Group & add ‘JUnit Request’ Sampler to Thread Group. On a porting successfully you can select your functional test script class file & method name in Junit Request component. The JUnit Request implementation supports standard JUnit convention and extensions. The following JUnit4 annotations are recog- nized: @Test - Used to find test methods and classes. @Before, @After- Annotating a public void method with @Before & @After causes that method to be run before & after the Test method. @BeforeClass, @AfterClass - Treated as test methods so they can be run independently as required Step4: Select the JMeter class & testJMeter method under the Classname & Test Method in the JUnit Request compo- nent. Step 5: Add all the required JUnit components for Result analysis & define the thread properties in ‘Thread Group’ to run for required number of instances to generate the load on server. Step 6: Save the Thread Group Test Script files to .jmx format & start the execution in JMeter. The benefit of Selenium for functional testing using Junit4 framework, provides the ability to utilize the same scripts for Perfor- mance testing in JMeter. This makes the Open Source Integration of Functional & Performance testing, which is Selenium Integration with JMeter. T E S T D I G E S T © 2 0 1 4 M A R L A B S S O F T W A R E P V T L T D P A G E 4
  5. 5. “Wearable Device” refers to electronic technologies that are incorporated into items of cloth- ing and accessories which can comfortably be worn on the body. These wearable devices can per- form computing tasks similar to mobile phones and laptop com- puters. Its strength is the ability to do multitasking wirelessly, con- sistently and with out distracting from what the user currently do- ing. It augments all other actions by being a prosthetic extension of users mind and/or body. AWARDS: GLASS received recognition by Time Magazine as one of the "Best Inventions of the Year 2012” "Machines should do what machines do best, thereby freeing up humans to do what they do best" - - - - Douglas Carl Engelbart [Inventor and an early computer and Internet Pioneer] SOMETHING W E ALL SHOULD KNOW ABOUT … Google Glass is a wearable Android-powered computer built into spectacle frames that perch a display in your field of vision, film, take pictures, search and trans- late on the go as well as run specially-designed apps. • Google Glass uses a miniature display to put data in front of your vision courtesy of a prism screen. This is designed to be easily seen with- out obstructing your view. • Glass responds to voice commands as well as taps and gestures on the touch-sensitive bar that runs along the side of the frame. You can start a search with "Ok Glass.." and take a photo or launch an app with a command phrase or a tap of your finger. Glass can also be paired with a phone using the My Glass app to allow quick fiddling with settings and customization. • Google Glass runs a version of Android, this makes it easy for developers to create apps that take advantage of its unique display and input methods. Developers using Google's Mirror API, which makes it possible for apps to speak di- rectly with a Glass headset, are forbidden from charging for their software or embedding ads in the Glass display. • You'll be able to use Google Maps to get direc- tions although as there is no built in GPS receiv- er you'll need to tether Glass to your smartphone. Several third party developers have announced apps for services including Ever note, Skitch and Path. • Google has snapped up voice specialists DNN- research whose voice recognition tech could give Glass the ability to translate words being spoken to you into your own language on the display. But obvious you'll need a WiFi connec- tion or a hefty data plan if you're in another country, but it's certainly a neat trick if it works. "To be there when you need it and get out of your way when you don't.", is what, accord- ing to Google , GLASS is created for.  Challenges of Wearable Device Testing : what it means to QA/Test Here’s a look at some top wearable tech concerns for QA professionals. Concern #1: “What’s a good user experience for a wearable tech device?” The onset of wearable tech UIs will redefine usability testing for QA professionals. User experiences will need to be stripped down to their core. The differences between usability testing an iOS app and an Android app will seem mini- mal when testing the usability of a wristband or a pair of glasses and how they connect to a mobile device. Concern #2: “Wearable tech makes me look like an idiot!” While the usability of the software itself will need to be tested, the experience of the device itself will need to be tested as well. Does it makes sense? Are the features easy to use and helpful? Do certain parts of the device get in the way on -the-go? Concern #3: “Device fragmentation just got even more fragmented!” Wearable technology will require testing the device itself, its software, and how it communicates with other devices. This isn’t something you can automate. Wearable technology needs to communicate with your body and perform correctly under a series of unique daily scenarios. Functional, usability, and security problems will occur in ways testers have never seen before, and thorough testing is the only way to identify the bugs and glitches pre-launch. T E S T D I G E S T © 2 0 1 4 M A R L A B S S O F T W A R E P V T L T D If you always do what you always did, you will always get what you al- ways got. - - - Albert Einstein P A G E 5 By Kalapana Nayakula
  6. 6. T E S T D I G E S T © 2 0 1 4 M A R L A B S S O F T W A R E P V T L T D Speak Up !! Your views makes us better. Please write to Test.Digest@Marlabs.com P A G E 6

×