Saturday, February 5, 2022

Strings

In Java, a string is an object that represents a sequence of characters. The java.lang.String class is used to create string object.

String contains an immutable sequence of Unicode characters.


1. Create a String:

//Using String literal

String str1 = “Welcome 1”;

//Using new keyword

str2 = new String(“ Welcome1 ”);


2. Immutable String:

class Stringimmutable

{

public static void main(String args[]) {

String s=“SoftwareTesting”;

s.concat(“Strings”);

}

}


3. Methods of Strings:

//compares address

str1==str2 ;

//compares the values

String newStr = str1.equals(str2);

//compares the values ignoring the case

String newStr = str1.equalsIgnoreCase();

//calculates length

newStr = str1.length();

//extract i’thcharacter

newStr = str1.charAt(i);

//returns string in ALL CAPS

newStr = str1.toUpperCase();

//returns string in ALL LOWERvsCASE

newStr = str1.toLowerCase();

//search and replace

newStr = str1.replace(oldVal, newVal);

//trims surrounding whitespace

newStr = str1.trim();

//check for the values

newStr = str1.contains(“value”);

//convert String to character type array

newStr = str1.toCharArray();

//Check for empty String

newStr = str1.IsEmpty();

//Check if string ends with the given suffix

newStr = str1.endsWith();


STRING CONVERSIONS:

1. String to Int Conversion:

//Converting a string to int

String str=“123”;

int inum1 = 10;

int inum2 = Integer.parseInt(str);

2. Int to String Conversion:

// Conversion of Int to String

int var = 211;

String str = String.valueOf(var);

System.out.print1n(111+str);

3. String to Double Conversion:

//displaying the value of variable dnum

String str = “111.222”;

double dnum = Double.parseDouble(str);

4. Double to String Conversion:

//conversion using valueOf() method

//double value

double dnum = 11.222;

String str = String.valueOf(dnum);


This article focuses on Strings Basics, its methods and Conversions.

Thanks for reading my article..!!!!

Happy Strings!!!!

Saturday, January 8, 2022

What is TestNG?

TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionality that makes it more powerful and easier to use.

It is an open-source automated testing framework. TestNG is similar to JUnit.

It is designed to be better than JUnit, especially when testing integrate classes.

TestNG eliminates most limitations of the older framework and gives the developer the ability to write more flexible and powerful tests with help of Easy Annotations, Grouping, Sequencing, Parameterizing.

Benefits of TestNG in terms of Selenium testing are:

·        It gives the ability to produce HTML Reports of execution

·        Annotations made testers life easy

·        Test cases can be Grouped & Prioritized more easily

·        Parallel testing is possible

·        Generates Logs

·        Data Parameterization is possible


Friday, December 24, 2021

USABILITY Testing

 In this article, we will see about Usability Testing and how it will performed and significance of it.

Firstly , What exactly is Usability Testing?

Testing the user friendliness of an application is called Usability testing.

Let us start with an example such that we have two applications A & B which are different but doing the same job. In this, we see which one is user friendly.

Given below are some of the parameters we look into for testing. In this most of them are not measurable,

ü  Speed

ü  Help

ü  Navigation should be simple

ü  Compatibility

ü  Look & feel

ü  Features

ü  Location of components

One important parameter other than the above said parameters is “Effort needed to learn the application”. 

Suppose in the example, we understand the software A in 2 hrs, but we take 4hrs to understand B. Let us see different cases here,

®    since we understand A in 2hrs, it becomes user friendly compared to B

®   suppose look & feel is not good for A. In this case though, we understand A in 2hrs, we cannot say that A is user friendly.

®    Therefore, we look into many parameters before we say user friendliness of a software

 What is LOOK & FEEL?

The application should be such that it should be pleasant looking [ suppose if we have red color text in yellow background, definitely we don’t feel like using it ] and make a feel to the end-user to use it.

 Let us now see an example of Usability testing:

1) Consider some of the examples below,

In this example, we see the Inbox – the most frequently used feature is not kept in the right place.

End – users therefore search for the Inbox & after sometime, they find the Inbox lying somewhere down.

This type of application may lose the customers because they are less user – friendly.

How to overcome this,

See to it that the important features are placed in the left navigation bar and top navigation bar (This is normally followed)

Then we should see whether frequently used features are easily accessible (like Inbox, Compose Mail etc)

While testing, we therefore have to list all the important features before we start testing an application.

2) Consider the sketch shown below,

The end – user to draw the above sketch every time, he clicks Tools -> Draw -> Line for each line and finally he clicks Tools -> Draw -> Line to complete the sketch.

In this , we see the end-user wants to draw a simple sketch, but he wastes his time in clicking each time the Tools -> Draw -> Line for the sketch. This becomes a waste of time for the end-user.

Therefore, while testing , we must make user friendly of the application by creating Tool bar which makes the job simple by clicking on the necessary tools instead of going & clicking each time Tool -> Draw -> Line

How to conduct Usability testing? (OR) What process will  follow to do Usability testing?

Prepare OR derive checklist (i.e, what are the points to be checked). If we don’t prepare a checklist, we may miss some features in the application.

For Usability testing, we should prepare a genuine checklist specific to the product we develop.

 Example of a checklist for an application,

ü  For this application, one of the checklists includes color of already checked link should be changed to red

ü  All the images should have alt tag(Tooltip)

ü  All the pages should have link to Homepage

ü  Login feature should have Forgot Password link

 Like the above checklist, we can derive as many checklists as possible based on the application (or) product. While deriving checklist, we should derive a common checklist which can be executed for all pages.

Hope the article helped you to understand about Usability Testing.

Thanks for reading my Blog, 

Hope you liked it.

Happy Testing!!!!


 



 

Saturday, November 6, 2021

Characteristics of Good Test Case!!!!

 

  1. Test cases should have very good test case coverage.
  2. Test Cases should have good coverage with less no. of steps.
  3. Test Case should be written by applying test case design techniques.
  4. Test Case should be simple to understand.
  5. If test cases given to any new Tester, he/ she should be able to execute the test cases without asking any questions or clarifications.
  6. Test Case should be written in test case template.
  7. Test Case should be consistent, means flow or sequence should be good. 
  8. Test Case should consists of both positive and negative scenarios.
  9. Test cases should be able to catch the defects.
  10. Test cases should not be redundant, means no duplicates.
  11. Test Cases should be very easy to convert into Automation scripts.

These are the characteristics of Good Test Case.

Thanks for reading my article.

Happy Testing !!!!