Wednesday, March 21, 2018

Sikuli to the Rescue


              Current trends in Software testing leads us towards learning the tools that would be the right candidate for doing any particular task, just like finding the right hire from the interview. This task can be anything from taking a screenshot or screen capture video, or creating a presentation or testing a website in multiple browsers or automating a small windows based installer. There are so many tools available in the market for testing, but difficult task for me recently was trying to find the right tool to automate an application created using Java Swing.

            Swing is a set of program components for Java programmers that provide the ability to create graphical user interface ( GUI ) components, such as buttons and scroll bars, that are independent of the windowing system for specific operating system .While Swing is helpful in creating GUI faster, it provides a challenging ground for recognizing objects to automate them for testing.

           What better way to find answer to any question other than saying "OK Google". After searching for hours on google and having top 3 choices for automating Swing UI, as per all recommendations.
  • JuBula
  • AssertJ and 
  • Sikuli
The following are the required properties for the tool,
1.     should be able to start scripting right away (May be an IDE)
2.     should be easily integrated with Jenkins and Selenium.
3.     should be maintainable and not require separate install process
4.     should be able to test record and playback
5.     should be easier to use for testers with any level of coding knowledge

SIKULI
Sikuli is an excellent tool to automate any application as long as you can overlook the only negative of saving the objects as images to the drive or cloud. This small overhead is ok, when compared to the ease at which we can automate any application quickly. Sikuli is free opensource tool that can be used to automate any kind of application, be it Desktop or Web based application. We create a folder of all objects as PNG files.
Add the dependency to PM file

<groupId>org.sikuli</groupId?
<artifactId>sikuli-api.standalone</artifactId>
<version>1.2.0-SNAPSHOT</version>
<packaging>jar</packaging>

Then create an automation script using Selenium or any other tool or IDE you are using. Sikuli also provides a Sikuli IDE, which can be used to create scripts right away to test compatibility. We can use the pattern and the screen class to access the objects and perform actions,

Screen screen = new Screen();
Pattern image = new Pattern("C:\\searchButton.png");
screen.wait(image, 10);
screen.click(image);

JUBULA


Jubula is an eclipse project, for automated functional testing. This tool is easier to use with its own Graphical user interface and can be useful in automating desktop components. Jubula has a workspace and can be easily run from Jenkins or other CD\CI tools. The user can add events like click, type or select. They have various components like
Textbox, Button, List and Combo boxes. The script is created with the required component actions. Then Application Under Test (AUT) is opened using the Jubula AUT. Map the events to objects from AUT.




  •      The only problem that stopped me from using this tool is that we have manage and maintain the database and tool.
  •       This tool need to be maintained, in spite of managing the automation com.
  •        It is difficult to integrate with Jenkins.
AssertJ

AssertJ core is a Java library that provides a fluent interface for writing assertions. Its main goal is to improve test code readability and make maintenance of tests easier.

  •        Does not have any ease of use
  •        Does not have any IDE and takes time to learn.
  •        AssertJ is used more for Unit testing than front end UI automation
  •        This library need to access the Java class of the application to recognize objects


Friday, January 23, 2015

Do you know NULL (In Oracle)



We can see all around the web and even in many teams, people who port data from SQL server to Oracle a little frustrating due to the presence of NULL. A thorough understanding of NULL and its implication on various operations is required to avoid this frustration.

In all queries below, I have used default tables in Oracle HR schema.
NULL is not equal to 0. NULL is not equal to NULL .

NULL and arithmetic operators,

When any arithmetic operation (addition, subtraction, multiplication and division)  is performed in the column with null value results in NULL.

To resolve this we can handle the null values using the null functions.
select (null+10) from dual; --- >> results in NULL
select (null-10) from dual;  --- >> results in NULL
select (null*10) from dual;  --- >> results in NULL
select (null/10) from dual;  --- >> results in NULL
Any operation using number or date column using NULL results in NULL.

When using character string and null,
select (null||'accepting null') from dual;   --- >> results in accepting null

IS Null,

select last_name,commission_pct
from employees
where commission_pct is NULL;

is not the same as

select last_name,commission_pct
from employees
where commission_pct = NULL;

The first query returns 50 records whereas the second one returns 0 records against the same table. The first query is the right syntax while the second is not.

NULL when using IN,

select employee_id, commission_pct
from employees
where commission_pct IN ('0.3',NULL);

The employees table has records containing NULL and 0.3 in the commission_pct  column. But the above query only gives the data set with values of 0.3 and ignores the columns with null.

select employee_id, commission_pct
from employees
where commission_pct NOT IN ('0.3',NULL);

The abovne query does not give records do not contain 0.3 or null in commission_pct. But the result set contains no records.

NULL in Single row functions,

select concat('Outer',concat(null,'Inner')) from dual;

Null in the above concat function is not converted to string. The Null is ignored in the concatenation and the result is ‘OuterInner’

Select length(null) from dual;

The result of the above query is null.
Most of single row functions results in null if null is passed to it.

NULL in group functions,

The concept of null and group functions can be discussed about two pointers.

The Null if passed as an argument in group functions Min, Max, Sum, Avg will result in null as these are arithmetic operations.

The Count function returns the count of non-null values of the expression passed to it

Select count(dummy), count(null) from dual results in 0,0

So it returns 0 since the above expression returns null.

Select count(commission_pct) from employees returns 35 even though the column has  107 records, the other 72 rows has null records. To handle this situation we make use of one of the null functions explained below

NULL functions,

The NVL, NVL2 and NULLIF are most commonly used null functions

NVL(original,ifnull)
NVL(employee_address,’NO address for this employee’)  -- This function returns the employee_address column if its not null and if its null returns the string ’NO address for this employee’

NVL2(original,ifnotnull,ifnull)
NVL2(employee_address,’This employee has address info’,’NO address for this employee’)
This function returns ’This employee has address info’ if this column is not null and if this column has null value returns the string ’NO address for this employee’

NULLif(term1,term2)
The term1 and term2 are compared , if they are equal null is returned else term1 is returned
Nullif(1234,1278) – this function returns 1234 since both are not equal.

One example with both null and group function below,

Select count(nvl(commission_pct,0)) from employees;

This returns all the rows from employees table which is 107 records.

Happy Querying!!!







Thursday, August 28, 2014

QTP trick when object is not recognized - Mouse replay type

                When you start learning a new language or tool when you correct your first mistake you remember it forever. The human brains remember the first failure as well as the workaround really well. So when startng to learn QTP I was using online videos from http://www.itelearn.com/

I encountered the error when the object was recognized using object spy and the object properties.
When I tried to run the script I got the error "Object not found". When I consulted my good old friend "Google" I got a lot of pointers for what to do when QTP does not recognize your object,

*Check the addins are loaded.
*Try to use GetVisibleText
*Create object using decriptive programming
*Search HP knowledge base.

But my problem was the object was in repository and recognized by QTP.
The test failed during Runtime. So after research found my fix. I had to change the click type to mouse expluicitly using the below code,

Setting.WebPackage("ReplayType") = 2 'Runs mouse operations using the mouse
browser("Gmail").Page("Inbox").WebElement("COMPOSE").Click
Setting.WebPackage("ReplayType") = 1 'Runs mouse operations using the Browser events


Also remember to reset it to 1 before rest of script gets executed.

Happy learning

Thursday, May 1, 2014

What is cloud computing?  By wiki definition, Cloud computing is computing that involves a large number of computers connected through a communication network such as the Internet. This technology launches the application over the internet and users do not have control over the data storage or the hardware used by the application. The same way 90s big mainframe machines gave way to desktops and then laptops with home internet, the age of data storage in big size servers giving way towards more and more on clouds. What does this change mean to me?  The best example is my computer/data can be accessed anywhere using just a web browser, using one drive https://onedrive.live.com/ for the files in my laptop. We are using cloud at various levels, hardware, storage, data maintenance and so on.

Virtualization has led to cloud computing in many ways. Virtualization is the separation of the OS from the underlying hardware. In the olden days way back in 08 or 09 we would install the Operating system in a computer based on whether it is HP, Dell. The Operating System has been tied to the device drivers for a long time.  Virtualization is the process in which a layer called hypervisor is installed and the applications are installed over it.

                 
              

Why should a business look into Virtualization? Most applications require their own physical hardware to remain separated from other applications on the network, which can become very cost prohibitive. Secondly, most applications are not utilizing the full power of today’s server hardware, so why not find a better way to fully utilize the servers on your network? With Virtualization, it is now possible to create several “virtual” servers on a single physical server, each running independently of the others. This allows you to keep applications from conflicting with each other and better utilize the resources available on the server, all while maintaining a cost effective approach to new server purchases.

Virtualization is the key to cloud computing in unlocking the potential for better software manipulation. Virtualization of computer hardware has led to the delivery of various computing resources over the network as a service. The major IT companies can save by maximizing resources in multiple systems. They can install various software with different OS requirements in a single server. This reduces the need to buy many servers. This saves a lot of money for small businesses which can be invested back in to business development.

One most important advantage of improves in cloud services nowadays is really the presence of virtual offices for many of us. We nowadays see a lot of projects working all over the globe. The globalization is due to the presence of virtual servers and having all files online.
The product that had its origin in early days of cloud and has grown ever since is the dumb terminals. The best example of dumb terminal is Chromebook. Chromebook is the laptop in which the local storage is kept minimal. The user should do everything from a browser and store it in the cloud. You would have guessed by now why it is called dumb terminals all over the internet. The biggest disadvantage comes when the system is without an internet connection. The user does not have control over the data which leads to security issues. Anyone can hack in to the virtual machine and hack the personal data more easily. The security issues are in the news few times a month nowadays, the internet explorer malware, AOL password hack to name a few in news end of April 2014. But in the past few years the technology has shaped our thought process so that we are over the fact of security since the sales of chromebook seem to be increasing and so are cloud services in our daily life.

                                                      

                                               

The cloud computing services can be divided in to three main areas, SaaS (Software as a Service), PaaS (Platform as a Service), and IaaS (Infrastructure as a Service). SaaS provider gives access to software over the internet, and maintains the data center in most cases. Salesforce.com, Intuit QuickBooks, Citrix Goto meeting are example of SaaS CRM application. The users can access the application through a web browser. Due to Saas advancements the companies can use the IT staff for various new innovation rather than maintenance of existing projects. Also the support for the software is provided without a increasing the workload on local helpdesk.  PaaS (Platform as a Service) is the delivery of development platform hosted in the cloud without the need for installation of software in the local machine. It is similar to Saas, but instead of delivering the software over the cloud, we have development environment over cloud.  This enables application development to be faster without the need to buy the hardware and software licenses.  The users do not have to worry about upgrades and can increase the effectiveness and interactivity of a large staff. IBM Bluemix.net, Microsoft Azure are some services which offer the platform over the web. IaaS (Infrastructure as a Service) is a model to deliver Infrastructure, storage, network and servers over the internet to the user. The user can rent the server in third party infrastructure in exchange for a rental fee. Compared to SaaS and PaaS, IaaS users are responsible for managing more: applications, data, runtime, middleware, and O/S. Vendors still manage virtualization, servers, hard drives, storage, and networking. When the business is new without much capital to invest in infrastructure, or when the IT company wants to limit the budget, when someone wants to try a new software, they can easily try their application in the cloud.   

The network crashes can cost a lot more nowadays than in the past. The same goes without saying for hacking and other concerns. The days and our life were different when we were children and used to play outside due to power failure in our whole street. I still remember screaming and playing in the dark in India. The lives of our kids are different, they have a meltdown and do not know what to do when the internet is down and so is Facebook server. We all remember the crash of amazon servers that lead to Netflix, Pinterest crashes in 2012. http://www.pcmag.com/article2/0,2817,2406577,00.asp.

Cloud computing is a concept that is driven by virtualization and improved the quality of our online lives by letting us manage less amount of servers and data, but giving the privilege of using the various software products. We have discussed the advantages and disadvantages of cloud computing intertwined in this article rather than having subheadings. I also have some examples of various software solutions that would help us better understand the topic.

References:
Images are from http://commons.wikimedia.org/ and labelled as “Non Commercial reuse”


Monday, April 14, 2014

Formula for successful QA tester

Bling or Blah, Boring

When I was checking the news yesterday and hearing the current debate about standardized tests in schools in NYC this made me think about my Career/ Passion. In India, when I started my career lot of people used to make fun of testing team saying it is the boring job and not for engineers. In my opinion if you ever think like that and not ready for rewiring yourself with the trend then you cannot be passionate about Quality Assurance/ testing.

As a software tester I have seen many fellow testers when trying to find next job there is a real need to stand out in the pool of resumes any employer receives. Anyone in QA knows the number of resources available in market at any time for a particular position. Here I go with my formula for success as a QA resource. These are the 5 Qualities of a Quality Assurance analyst/tester that makes you the best and lets you stand out from the rest.



Formula for being successful QA Analyst


Evolve with Technology
The tester in any project should have a really good understanding of the application. The QA team has the responsibility to make the application results in a great user experience. Anyone working as a tester should remember the importance of reading some websites or blogs like softwaretestinghelp.com and stickyminds.com. Recently when browsing online for such articles read this quote from testing guru “When asking a team of  software testers on what is the best book on software testing, most replied they haven’t read one” . The tester should rewire themselves at the speed of today's technical evolution and improve knowledge base for testing various applications.

Sense of responsibility
Many days in our life as Tech worker we feel that we want to disappear and be out of this problem. But blame game is not an option for growth in our career. We have to take responsibility for our actions and stop from blaming the developer for wrong code or the user for incomplete requirement. The role and visibility of the tester in a project increases with increase in ownership of the functionality. Anyone can blame someone and escape from the scenario in junior level, but not in senior roles. Any exception in code has to be handled with an error message rather than crashing an application.

Domain Expert
In many places the jobs are based on a particular domain. When you live close to NYC there is more concentration of banking or insurance companies. If you live in CA the jobs are based on latest technologies like twitter or mobile apps. The communication between the end user and application developer in common language about key terms regarding the business.  Anyone cannot really understand the application functionality without the knowledge of key terms in particular domain. As a Quality Assurance personnel one should have the business idea of the end user to add value to the team. So keep reading a lot and do work in projects in different domains to gain insight. I came across this site which explains about domain with real time examples, http://anil-businessanalyst.weebly.com/domain-knowledge.html

Automation tools
We have read so many articles and blogs that MANUAL TESTING is there to stay. It is true, but life gets tough when you are just a manual tester. Anyone can survive in today’s market with a good knowledge of automation. Whenever it is said, the next question is which one is the best tool to learn? The answer to this question is not any tool but knowledge of automation and a good knowledge of programming logic. Also many new projects nowadays goes towards open source tools as they are cheaper, easier to switch from one  tool to another and more compatible with agile user stories. So good tester should have a good understanding of automation and technical expertise on creating framework and scripts using one tool.

Certifications
A lot of my friends argue with me that certification does not place you in a job. But I have seen so many job openings in many websites with mandatory qualification being a certification. The days of real person looking at a resume are over, so when recruiting software skims through hundreds of resume, resumes with certifications are acting as filters. Also when recruiting for manual testing certifications help to judge the knowledge of testing concepts. Sometimes domain expertise can be gained with certifications even with little real time experience. If you complete a testing certification CSTE or CSQA without real time knowledge it may not help you. The technical knowledge and domain expertise is not valuable when one exists without another.

In my opinion the software tester life in USA as just a manual tester is numbered, since the tester need to deploy application and use automation tools to make testing efficient and effective in short span of time. The technology keeps changing from mobile to agile to cloud due to which people attention span gets shorter and shorter. So testing should be in short duration using agile techniques like SCRUM and Kanban. The tester has to follow the above things and make the client understand who the right jewel is for the king’s crown, aka next project.





Friday, April 4, 2014


Any human being wants to improve the quality of life. The same way in the software development process the most important role is that of the tester. The tester is the gate keeper of quality in any piece of software. The life of software tester has its evolution in the recent years. So I have given my pointers on the advancement of process and quality in this article.

One of the major changes in software industry in the recent years is the advancement of mobile technology and it revolutionized the software industry by creation of smartphone app for any major website. The key challenges in mobile app testing are diversity of platforms and variety of mobile devices available in market which makes it harder to automate as well. The main difference between mobile app and website is that we need to give more importance to performance and memory as well as UI. Also we need to test the functionality of the mobile phone like incoming call, text message and information pop up when using the application.  Mobile testing is challenging as we cannot test the application in every possible device used since it gets expensive to buy all the devices. We can use emulators for testing on various mobile phones and OS combinations without the need to purchase the real device.  Test LAB is also created by bigger companies with various devices and OS combinations. When the mobile app is released for a world market the tester should also take in to account the network and restrictions in various countries. The cloud computing helps a lot in this since testers can deploy the software over the internet in different type of servers.

Due to virtualization of data and globalization of companies, there is a need to store vast amount of data. A major retail corporation can have many departments’ sales, marketing, retail, customer, etc. The data is stored and managed in different databases and in different table formats. The ETL (extract, transform, and load) process takes data from various tables and formats (oracle, SAP) and load it into the data warehouse. The ETL testing process also involves test planning based on data mapping document, test data creation and approval, execution of test cases till the exit criteria is met and test completion report. The ETL test execution should test to avoid data loses, verify data completeness, verify transformation rules, schema and referential integrity testing, data quality checks on target warehouse to name a few.

The American IT workforce has moved mostly from standard desktops to virtualized world. The mindset of people is more accepting to changing from workstations and huge servers for the company to hosting of services on cloud. This gives more flexibility for users to access their work from any laptop or mobile devices in their home. Anyone need to work on MS-Word need not own the software rather work on word online. This makes the life of tester difficult by making him test the software for more security issues and data leaks.

The mobile technology and the tight deadline for various projects have led to more companies adopting the agile methodology of software development.  In the Agile process, instead of waiting for software development to complete, testing is done in parallel. Testing is not considered a step in software development process but rather a coexisting force in creating functional software in existing time. Testers are included actively in the software development team and they contribute to improvement in user stories. They complete small iterations along with development team to create test data and decide on test tools. The strategy of an agile project can be Test Driven development (TDD) or Continuous integration (CI). The testing approach is either test immediately after or parallel independent testing. When the team follows a TDD approach, a test is written and enough software is deployed to make the test pass. Then the same process is repeated again till the whole application is developed. In parallel testing the code at end of day is deployed in server and the testing is done for that user stories alone. The whole project is approached with many iterations rather than single development phase followed by testing.

In Conclusion, testing process is becoming more proactive, risk based and tends to be short and sweet like a small tech video in TED. The tester should be more able to write more light weight test scenarios instead of detailed test cases, but with a complete coverage of the functionality. Also the tester should have a vast knowledge of the working of the cloud server and deployment of mobile applications across different mobile devices.