Wednesday, May 8, 2019

SOAP API Automation Framework



SOAP UI Automation Framework



Soap UI has a pro version and it has a licence cost. Still we can use the free version but has it own limitations and need to use a groovy language for scripting.

Soap Pro – Single user license cost around 800USD per year.

Not having advance reporting mechanism.

We can not run where we want .Limited to the tool.





Framework code can be found at :











Thursday, July 19, 2018

CICS Screen Automation Frame Work

As400 Automation

Things Needed Before Start

  1. Java  Knowledge
  2. TestNG
Introduction To CICS Screen



Terminal Types

  1. TN5250
  2. TN3270

Architecture






Sample Code 

Login Function

public class Login extends FunctionBaseTN5250 {

    
    public static void loadBox(String stripAdress, String strbox) throws Exception {
        connectToBox(stripAdress, strbox);
        waitForScreenwithText("USER ID", 5);
    }

   
    public static void LoginToBox(String strUserName, String strPassword) throws Exception {

        sendText(strUserName, LoginPage.getRowNoUserNameField(), LoginPage.getColNoUserNameField());
        sendKeys(TAB);
        sendText(strPassword, LoginPage.getRowNoPasswordField(), LoginPage.getColNoPasswordField());
        sendKeys(ENTER);
    }

}


Login Page

public class T5250LoginPage {

private static int rowNumberUserNameField = 13;
private static int colNumberUserNameField = 41;

private static int rowNumberPasswordField = 14;
private static int colNumberPasswordField = 41;

}


Login Test

public class LoginTest  
{

    @BeforeClass    
    public void init(ITestContext iTestContext)
    {
    }
    @Test
    public static void PurchaseOrder() throws Exception{
         Login. loadBox(iPAddress, box);
         Login. LoginToBox(userName,password);
        

}


}

Friday, June 23, 2017

Setting Up Own Device Farm

Device Farm Diagram






First of all, you need 2 tools and mobile devices:

You have to download selenium grid and make a node as selenium grid hub.
Command => java -jar selenium-server-standalone-2.53.0.jar -port 4444 -role hub

Now navigate to http://localhost:4444/grid/console  see selenium grid is functional.

Create a json file to configure the mobile devices

ssample json file,save this as deviceName.json file


{
    "capabilities": [
                     {
    "browserName":"iPad Air",
    "platformName": "iOS",
                     "maxInstances": 1,
                     "deviceName":"ipad Air"
                     }
                     ],
    "configuration": {
        "cleanUpCycle": 2000,
        "timeout": 30000,
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "host": "127.0.0.1",
        "port": 4726,
        "maxSession": 1,
        "register": true,
        "url": "http://127.0.0.1:4726/wd/hub",
        "registerCycle": 5000,
        "hubPort": 4444,
        "hubHost": "127.0.0.1",
        "hub": "127.0.0.1:4444/grid/register"
    }
}


Configuration Description
host : appium server host
port : appium server port

Now you have to run the following command to start the appium server with above config


appium --session-override --nodeconfig /Users/rifad/Desktop/iPad.json -p 4726 --bootstrap-port 2252 --udid 021YHB2133086676

You can register as many devices you want.
***********************

appium Rifad$ appium --session-override --nodeconfig /Users/rifad/Desktop/iPad.json -p 4726 --bootstrap-port 2252 --udid 021YHB2133086676
[Appium] Welcome to Appium v1.6.4
[Appium] Non-default server args:
[Appium]   port: 4726
[Appium]   bootstrapPort: 2252
[Appium]   sessionOverride: true
[Appium]   nodeconfig: /Users/indikat/Desktop/orderPad.json
[Appium]   udid: 021YHB2133086676
[Appium] Deprecated server args:
[Appium]   -U,--udid => --default-capabilities '{"udid":"021YHB2133086676"}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium]   udid: '021YHB2133086676'
[debug] [Appium] Starting auto register thread for grid. Will try to register every 5000 ms.
[Appium] Appium REST http interface listener started on 0.0.0.0:4726
[debug] [Appium] Appium successfully registered with the grid on 127.0.0.1:4444

***********************








You can now simply choose your device from appium capabilities and run the test on the desired device.

Sample Capabilities

capabilities.setCapability(MobileCapabilityType.UDID, DEVICE_UUID);
capabilities.setCapability(MobileCapabilityType.APP, APP_PATH_REALDEVICE);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "iPad Air");//Device name in selenium grid

capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, PLATFORM_NAME);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, PLATFORM_VERSION);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AUTOMATION_NAME);

capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
capabilities.setCapability(MobileCapabilityType.AUTO_WEBVIEW, true);
capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
capabilities.setCapability(MobileCapabilityType.NO_RESET, true);


Note : This will be work on the same network or we have to disable the firewall for 4444 port if it in different network.











Wednesday, June 21, 2017

Appium Ios Automation

Skip to end of metadata

Requirements

  • Mac OS X 10.10 or higher
  • XCode >= 8.3.2
  • Apple Developer Tools (iPhone simulator SDK, command line tools)
  • Appium
  • Java latest version

Installing Xcode

  • Navigate to apple software downloads page Apple Downloads
  • Download Xcode and install
  • Download command line tools and install.

Install Java

Appium Installation

  • Install brew
    open command line terminal  in mac  and run the following command
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  • Install Node
    Open the terminal and run the following command
    $ brew install node

  • Install Appium
    npm install g appium@appiumversion
    eg : npm install g appium@1.6.5

  • Check Appium works 
    $appium
    If you install appium successfully you will see the following server log and you are ready start IOS automation.

   
     brew install libimobiledevice --HEAD 
           brew install carthage
     npm install -g ios-deploy


Running Your Test In Real IOS Device

  • You have to have your own .ipa file which is related to your application.
  • You should have the required certificated and provisioning profiles related to the development team.
  • Sample test without code modules.

Saturday, February 8, 2014

Experience as a QA in Scrum

Scrum is an Agile approach to software development, which focuses on delivering valuable business features in short development iterations of 2 to 4 weeks. Scrum teams have two defining characteristics – they are cross-functional (i.e. they include every skill set necessary to get the job done) and they are self-organizing (i.e. the team is expected to figure out how best to get the job done). After working for nearly two years as a quality assurance (QA) analyst on a Scrum team, I have learned that the role of QA in Scrum is much more than just writing test cases and reporting bugs to the team.
Contrary to the synchronous activities of a traditional Waterfall project, Scrum expects development activities to be performed in the order they are needed – i.e. asynchronously. This break from tradition raises a common question by many of the clients, developers, and business stakeholders new to Agile – “How can testing professionals engage effectively during a sprint before anything has been built?” This article focuses on explaining how the QA role performs agile testing and the place of importance they hold on a Scrum team. Much of what I have learned about the roles and responsibilities of QA on a Scrum team I will be sharing with you throughout this article. 

More Than Just Building Test Cases

On traditional Waterfall projects the QA role is only involved at the very end of the project – once all coding is complete. On these projects, the QA role would typically be given a requirements document and the completed code and would be expected to write and execute test cases which verify that the application does exactly what the requirements document says. However, the QA role in Scrum is not just about executing test cases and reporting bugs .On a Scrum team the QA Analysts participate and fulfill a variety of responsibilities conjointly with other team members. They are involved right from the very beginning of a project where they work closely with business analysts and developers. In Scrum, the QA role is not a separate team that tests the application being built. Instead the Scrum team is a cross-functional team where developers, business analysts and QAs all work together. Apart from building test cases, QAs can also help the Product Owner (PO) write acceptance test cases by playing the role of proxy product owner. Having QA fill in as a proxy for the Product Owner when they are not available helps keep the team moving forward at all times. They can also interact with the Product Owner by asking questions and challenging assumptions to help clarify the business requirements. 

Participate In Estimating Stories

Quality assurance analysts are typically very good at creating test case scenarios based on user requirements. They also excel at identifying and capturing complex and negative test case scenarios. In fact, they are typically much better at it than developers, who tend to focus mostly on the “happy path” of the user story. Including testers during Release and Iteration Planning, when user stories are estimated, can help the team think beyond the happy path. This helps the team produce a more realistic estimate since both “happy” and “unhappy” paths have been considered. Estimation is a tough task and it is good practice to have the whole team participate in coming up with the estimate. 

Help Keep Vision And Goals Visible

As the team works through the testing and stabilization activities, QAs should take the lead to plan, organize and involve the whole team in the testing work and to keep people motivated just as the Scrum Master (SM) does. Since very few developers enjoy testing work, the QAs , along with the Scrum Master, must make the testing vision and goals visible to the whole team and help to keep the motivation level of the team high. Sometimes it helps to be creative when testing scenarios require help from developers or other team members. Try making the testing activity fun by using amusing test scenarios, funny test data, fun competitions, etc. Do what you can to help the team enjoy and contribute to the testing work. 

Collaborate With Customers And Developers

One of the primary responsibilities for the QA role is to provide feedback from their testing experience to the Product Owner as well as collecting feedback from them. QAs work closely with the Product Owner to help them develop detailed acceptance criteria for their user stories. Based on what the team learns during each sprint, QAs can also help the Product Owner modify or enhance existing user stories to better reflect the true requirements.
On occasion, the quality assurance analyst may be asked to act as a proxy for the Product Owner. In these situations, QAs and developers will sit and work together as a team to help improve the quality of the project. The QAs can pair up with developers for writing unit test cases and for discussing acceptance criteria. The more these roles work together, the greater the shared clarity will be on requirements. The increased clarity that results from working together will reduce the questions and doubts developers often encounter during coding time, which produces greater efficiency and a big time savings for developers and testers alike.
The whole team should be expected to pitch in and assist with testing whenever required based on the needs and the availability of team members. This practice helps create balance in the team and a shared responsibility for getting the work completed. It also helps produce the required pace to move faster with early testing feedback and increased quality. 

Provide Fast Feedback

The build-test-fix cycle that traditional Waterfall teams repeat endlessly produces a lot of extra work for the team and usually ends up wasting a lot of time. This activity is much simpler in Scrum as QAs and developers work together throughout the entire process. Developers can consult the QAs about acceptance criteria or the expected behavior of any functionality from the user's perspective while working on the feature, which results in saved testing and bug fixing cycles. 

Automate Regression Testing

It is often said that automation is the tester’s best friend since it provides repeatability, consistency, and better test coverage over the software’s functionality. This is particularly true on a Scrum project with small sprint cycles of 2-4 weeks, since QA generally has even less time to test the application. During each 2-week sprint, QA must perform full functionality testing of the new features being added during this sprint as well as perform full regression testing for all the previously implemented functionality. As would be expected, this responsibility grows significantly with each passing sprint so any automation that can be applied to these tests would greatly reduce the pressure the QAs feel.
Automated tests are particularly helpful in providing rapid feedback when teams implement Continuous Integration (CI). Each time there is a new build, the automated tests can be executed and provide immediate feedback as to whether the new features are working correctly or whether there have been any regressions of previously working functionality. Without automation, QA must perform these tests manually, which becomes a very monotonous and error prone task. Automation can help detect the defects early and give QA more time to explore the edge cases of the new features being developed. Automation can help QA deliver testing work much more efficiently and effectively. 

Participate In Release Readiness/Demos

At the end of each sprint, the team holds a Sprint Review meeting where the team must demonstrate the user stories completed during the sprint to the Product Owner and other interested stakeholders. This Sprint Review meeting provides a healthy dose of accountability to the team and motivates them to complete as many user stories as possible.
With small sprint cycles of 2-4 weeks, everyone on the team must stay focused on his or her respective tasks in order to complete them on time. Developers stay busy developing their assigned user stories and fixing bugs while QA stays busy writing test cases, clarifying questions from Product Owners, and automating previous sprint stories. Having short sprint cycles also means that developers have less time to explore the complete functionality of their user stories on their own. As a result, developers typically consult with QA to better understand the user stories since they are the ones aware of the complete functionality and know each and every requirement and acceptance criteria. As a result, it can be a good practice for QA to perform the demo at the Sprint Review meeting and field functional questions coming from business. That can free up the developers to handle any technical questions that surface. 

Analyze User Requirements

QAs are the proxy product owners of the Scrum team. QAs are generally good at understanding the business requirements from the user's perspective since they are often asked to use the application as the end users would. QA can help provide feedback to the Product Owner based on their testing experiences and can help the Product Owner better understand the application from the end user's point of view. 

Enforce the Definition of Done

Having a clear Definition of Done (DoD) is important to a Scrum team. A DoD is nothing more than a simple list of team defined completion criteria - all of which must be completed before the user story can be considered done. This list typically includes things such as writing code, performing functional and regression tests, and gaining the approval of the Product Owner. A very simple DoD might include the following:
  • Code Complete
  • Unit Test complete
  • Functional / UI Test Complete
  • Approved by Product Owner
While it’s not the sole responsibility of QA to define the DoD, it is often QA’s responsibility to monitor the work being performed by the team and to ensure that each completed user story meets the benchmark DoD. An efficient Scrum team will review their DoD before starting each new user story to make sure they know what is expected. A team’s Definition of Done is not static and may evolve over time as the Scrum team needs evolve. DoDs can be defined for sprints and release as well. 

Always Plan Testing With Testing Strategies

Since there is not a test lead or even a specific test team in Scrum, building a test plan or following specific test strategies on a Scrum team can be an issue. Scrum believes in preparing only enough documentation to support the immediate needs of the team. As such, QA will prepare just enough high-level documentation for test strategies and plans to guide the team. Since there are no QA leads in Scrum, the QA analyst typically decides the test strategies. 

Tester and Analyst Roles Converging

On Scrum teams it is common to see the responsibilities of QA and those of the business analyst begin to converge. The Business Analyst role is typically responsible for creating and maintaining the sprint and product backlogs, analyzing the user stories from the business perspective, and prioritizing the backlogs with input from the Product Owner. The QA role, on the other hand, is typically responsible for defining / refining the acceptance criteria for each user story, testing the completed functionality each sprint from the end user's perspective, and ensuring all previously completed functionality has not regressed. As QA tests each user story and verifies the defined acceptance criteria has been met from the end user's perspective they are also analyzing the user stories in term of the business as well. So, in many ways the QA role and the business analyst role share many of the same responsibilities, required skills, and overall objectives.
Normally, a Scrum team gets their user stories and the pre-defined project scope from the Product Owner at the beginning of a project. However, in Scrum the team is encouraged to suggest new features or changes to existing features if it will improve the end users experience. The team is also encouraged to recommend changes to the priority / sequencing of user stories in the backlog when they find technical dependencies that suggest a different implementation order would be more efficient. Whether its defining requirements, analyzing user stories, defining / clarifying acceptance criteria, building acceptance test cases, or closely working with customers, the roles of tester and analyst are clearly converging. While this offers many advantages – particularly for small teams - it also has its disadvantages as well. The biggest concern is that neither the tester nor the business analyst role will get as much attention as it would with a team member fully dedicated to that responsibility.

Conclusion

While QAs still write tests and report bugs, they also support many other roles and responsibilities on the team. They are an important part of the team and are involved in the project right from the very beginning.
Working as a QA Analyst on a Scrum team for the past two years has been a great experience and has provided many learning opportunities. I have filled many different roles and responsibilities including QA analyst, proxy product owner, helping developers write unit test cases, acting as the team's quality conscience, and keeping track of problems and software bugs. In short, this experience has added many wonderful skills to my toolbox and has helped me learn how to play many different roles – all at the same time. Most importantly it has taught me to ask questions rather than just follow the documentation and do whatever it takes to help the team succeed.
While QAs still write tests and report bugs, they also support many other roles and responsibilities on the team. They are an important part of the team and are involved in the project right from the very beginning.

Refrence : Articel by Priyanka Hasija is a Test Consultant at Xebia IT Architects.

Sunday, December 15, 2013

Top 5 Performance Testing Tools – Comprehensive List of In-Demand Tools with Download Link

  • Apache JMeter
  • NeoLoad
  • LoadRunner
  • LoadUI
  • WebLOAD

1. Apache JMeter

Apache JMeter
DescriptionOpen source load testing tool: It is a Java platform application. It is mainly considered as a performance testing tool and it can also be integrated with the test plan. In addition to the load test plan, you can also create a testplan.  This tool has the capacity to be loaded into a server or network so as to check on its performance and analyze its working under different conditions. Initially, it was introduced for testing the web applications, but later its scope had widened.   It is of great use in testing the functional performance of the resources such as Servlets, Perl Scripts and JAVA objects.  Need JVM 1.4 or higher to run.
Apache JMeter System Requirements: It works under Unix and Windows OS
Download link: Apache JMeter download

2. NeoLoad

NeoLoad
DescriptionLoad and performance testing software: This is a tool used for measuring and analyzing the performance of the website. The performance and the end result can be evaluated by using this tool and any further steps can be taken. This helps you in improving and optimizing the performance of your web application. This tool analysis the performance of the web application by increasing the traffic to the website and the performance under heavy load can be determined. You can get to know the capacity of the application and the amount of users it can handle at the same time. This tool was developed by a French company named as Netosys and it was written in JAVA.  It is available in two different languages; English and French.
NeoLoad System Requirements:  This tool is compatible on operating systems like Microsoft windows, Linux and Solaris.
Download link: NeoLoad download

3. LoadRunner

LoadRunner
Description: This is a HP product which can be used as a performance testing tool.  This can be bought as a HP product from its HP software division.  Also, it is very much useful in understanding and determining the performance and outcome of the system when there is actual load. One of the key attractive features of this testing tool is that, it can create and handle thousands of users at the same time. This tool enables you to gather all the required information with respect to the performance and also based on the infrastructure.  The LoadRunner comprises of different tools; namely, Virtual User Generator, Controller, Load Generator and Analysis.
LoadRunner System Requirements: Microsoft Windows and Linux are the favourable OS for this measuring tool.
Download linkLoadRunner download  

4. LoadUI

LoadUI
Description: Open Source Stress Testing Tool: Load UI is yet another open source and load testing software used for measuring the performance of the web applications. This tool works effectively when it is integrated with the functional testing tool soapUI. LoadUI is the most flexible and interactive testing tools. This allows you to create, configure and update your tests while the application is being tested. It also gives a visual Aid for the user with a drag and drop experience. This is not a static performance tool. The advanced analysis and report generating features allows you to examine the actual performance by pumping in new data even while the application is being tested. You need not bother to restart the LoadUI each and every time you modify or change the application. It automatically gets updated in the interface.
System Requirements: Cross platform.
Price: This tool being a open source application, it is available for free and everyone can have the easy access to its full source code.
Download link: LoadUI download  

5. WebLOAD

WebLOAD
Description: Load testing and stress testing tool for web application: To find out the bottlenecks of the website, it is necessary to examine the pros and cons. There are many performance testing tools available for measuring the performance of the certain web application. WebLoad is one such tool used for load testing and stress testing. This tool can be used for Load testing any internet applications such as Ajax, Adobe Flex, Oracle Forms and much more. Through this tool, you have the ability to measure the working performance and also its response to the users. This was developed by the Radview Software for the applicaion Tesing.  This tool was a famous and award fetching software of the Radview Software. This tool is widely used in the environment where there is a high demand for maximum Load testing. This tool gives you a clear information on the functionality and the actual capacity of the web applications.
WebLOAD System Requirements: Cross Platform.
Download link: WebLOAD download

Tuesday, December 10, 2013

Test case writing techniques for dynamic testing-cause effect Graph

Test case writing techniques for dynamic testing

Equivalence partitioning
Boundary Value Analysis
Decision table
Cause and effect graph technique
State transition diagram
Orthogonal array testing(OATS)
Error guessing.

We have some really good papers 1st, 2nd and 3rd points (Equivalence portioning, BVA and decision tables) here in STH. I am going to discuss about point 4 which is Cause and effect graph.

Cause-Effect Graphing is a technique which starts with set of requirements and determines the minimum possible test cases for maximum test coverage which reduces test execution time and ultimately cost.
The goal is to reduce the total number of test cases still achieving the desired application quality by covering the necessary test cases for maximum coverage.
But at the same time obviously there are some downsides of using this test case writing technique. It takes time to model all your requirements into this cause-effect graph before writing test cases.
Notations we are going to use:

Now let’s try to implement this technique with some example.
1. Draw a cause and effect graph based on a requirement/situation
2. Cause and Effect graph is given, draw a decision table based on it to draw the test case.
Let’s see both of them one by one.

Let’s draw a cause and effect graph based on a situation

Situation:
The “Print message” is software that read two characters and, depending of their values, messages must be printed.
  • The first character must be an “A” or a “B”.
  • The second character must be a digit.
  • If the first character is an “A” or “B” and the second character is a digit, the file must be updated.
  • If the first character is incorrect (not an “A” or “B”), the message X must be printed.
  • If the second character is incorrect (not a digit), the message Y must be printed.
Solution:
The causes for this situation are:
C1 – First character is A
C2 – First character is B
C3 – Second character is a digit
The effects (results) for this situation are
E1 – Update the file
E2 – Print message “X”
E3 – Print message “Y”
LET’S START!!
First draw the causes and effects as shown below:
Cause and effect graph testing 2
Key – Always go from effect to cause (left to right). That means, to get effect “E” ,what causes should be true.
In this example, let’s start with Effect E1.
Effect E1 is to update the file. The file is updated when
-  First character is “A” and second character is a digit
-  First character is “B” and second character is a digit
-  First character can either be “A” or “B” and cannot be both.
Now let’s put these 3 points in symbolic form:
For E1 to be true – following are the causes:
-  C1 and C3 should be true
-  C2 and C3 should be true
-  C1 and C2 cannot be true together. This means C1 and C2 ae mutually exclusive.
Now let’s draw this:
Cause and effect graph testing 3
So as per the above diagram, for E1 to be true the condition is
(C1  1C2) 2 C3
The circle in the middle is just an interpretation of the middle point to make the graph less messy.
There is a third condition where C1 and C2 are mutually exclusive. So the final graph for effect E1 to be true is shown below:
Cause and effect graph testing 4
Lets move to Effect E2:
E2 states to print message “X”. Message X will be printed when First character is neither A nor B.
Which means Effect E2 will hold true when either C1 OR C2 is invalid. So the graph for Effect E2 is shown as (In blue line)
Cause and effect graph testing 5
------------
For Effect E3.
E3 states to print message “Y”. Message Y will be printed when Second character is incorrect.
Which means Effect E3 will hold true when C3 is invalid. So the graph for Effect E3 is shown as (In Green line)
Cause and effect graph testing 6
This completes the Cause and Effect graph for the above situation.
Now let’s move to draw the Decision table based on the above graph.

Writing Decision table based on Cause and Effect graph

First write down the Causes and Effects in a single column shown below
Cause and effect graph testing 7
Key is the same. Go from bottom to top which means traverse from effect to cause.
Start with Effect E1. For E1 to be true, the condition is: (C1 1 C2) 2 C3 .
Here we are representing True as 1 and False as 0
First put Effect E1 as True in the next column as
Cause and effect graph testing 8
Now for E1 to be “1” (true), we have the below two conditions –
C1 AND C3 will be true
C2 AND C3 will be true
Cause and effect graph testing 9
For E2 to be True, either C1 or C2 has to be false shown as
Cause and effect graph testing 10
For E3 to be true, C3 should be false.
Cause and effect graph testing 11
So it’s done. Let’s complete the graph by adding 0 in the blank column and including the test case identifier.
Cause and effect graph testing 12

Writing Test cases from the decision table

I am writing a sample test case for test case 1 (TC1) and Test Case 2 (TC2).
Cause and effect graph testing 13
In a similar fashion, you can create other test cases.
(A test case contains many other attributes like preconditions, test data, severity, priority, build, version, release, environment etc. I assume all these attributes to be included when you write the test cases in actual situation)

Conclusion

Summarizing the steps once again:
  1. Draw the circles for Causes and Graphs
  2. Start from effects and move towards the cause.
  3. Look for mutually exclusive causes.
This finishes the Cause and Effect graph dynamic test case writing technique. We have seen how to draw the graph and how to draw the decision table based on it. The final step of writing test cases based on decision table is comparatively easy.
About the Author: This is a  article by Shilpa Chatterjee Roy. She is working in software testing field for the past 8.5 years in various domains.I have mad some minor changes to suite our context.