How to verify single checkbox in a webpage using selenium?

TestSteps

  • Open the Firefox browser
  • Navigate the AppUrl
  • Identify Checkbox1
  • Select Checkbox1
  • Verify Checkbox1
  • Close the current Browser window

Selenium Code :

——————–

package seleniumProject;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;

 

public class VerifyCheckbox {

public static void main(String[] args) {

  //open the firefox browser

WebDriver Driver = new FirefoxDriver();

  //navigate the AppUrl

Driver.get(“http://demo.guru99.com/test/radio.html”);

// Identify Checkbox1

WebElement CheckBox1= Driver.findElement(By.id(“vfb-6-0”));

//Select Checkbox1

CheckBox1.click();

   //Verify Checkbox1

if (CheckBox1.isSelected())

{

System.out.println(“Checkbox1 Selected”);

} else

{

System.out.println(“Checkbox1 not Selected”);

}

  //Close the current Browser window

Driver.close();

}

}

How to verify multiple checkboxes in a webpage using sselenium?

TestSteps :

  • Open the firefox browser
  • Navigate the AppUrl
  • Identify all Checkboxes and store into checkBoxes variable
  • Print the total checkboxes
  • Select multiple checkboxes one by one
  • Verify multiple checkboxes one by one
  • Close the current Browser window

 Selenium Code :

——————–

package seleniumProject;

import java.util.List;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;

public class Verify_Multiple_Checkboxes {

public static void main(String[] args) {

       //open the firefox browser

WebDriver driver = new FirefoxDriver();

  //navigate the AppUrl

driver.get(“http://demo.guru99.com/test/radio.html”)

     // Identify all Checkboxes and store into checkBoxes variable

List<WebElement> checkBoxes = driver.findElements(By.xpath(“//input[@type=’checkbox’]”));

   //print the total checkboxes

System.out.println(checkBoxes.size());

for(int i=0; i<checkBoxes.size(); i++)

{

  //select multiple checkboxes one by one

checkBoxes.get(i).click();

       //verify multiple checkboxes one by one

if(checkBoxes.get(i).isSelected())

{

System.out.println(i+” checkBox is selected “);

}else{

System.out.println(i+” checkBox is not selected “);

}

}

  //Close the current Browser window  

driver.close();

}

}

SELENIUM | BROWSER COMMANDS :

isSelected(): By using this we can verify particular checkbox is selected or not on a webpage.

 

Click here: Steps to configure Selenium WebDriver with java to develop test scripts

Click here: How to handle frame in selenium webdriver using java?

Selenium Training in Hyderabad

Kosmik Technologies is on of the best selenium training in Hyderabad. We are providing lab facilities with complete real-time training. Training is based on complete advance concepts. So that you can get easily “hands-on experience”. We will give 100% job assistance.

 

Manual testing interview questions
Manual testing interview questions
1) Difference between Regression and retesting?
 
Retesting:
 
When QA identified a defect, then it should be assign it to Developer. Once developer gives fix, then there should be retesting done to confirm defect has been removed or not. This we call RETESTING”. Retesting will done before regression.
 
Regression:
If any new code added to the application (New CR and Defected fixed code), ensure this new code doesn’t impact on other components of the system. Regression will done after retesting.
 
2) What are different phases in agile process?
 
Agile is very powerful SDLC methodology to implement software in a better manner.
 
  • Sprint planning.
  • Sprint meeting.
  • Sprint product demonstration.
  • Sprint Retrospective.
 3) Who Will prepare RTM(Requirement Traceability Matrix)
 
Requirement Traceability Matrix will ensure 100% test coverage. Which means every test case should be mapped to their corresponding Requirement. In an organization, QA Manager will prepare Requirement Traceability Matrix
  
4) Define Defect Life Cycle with defect status?
 
Defect life cycle starts with when defect found and when it successfully closed(also Known as Bug Life Cycle). In this defect undergoes different status, Which described below.
 
  • New: When QA member finds the defect.
  •  Open: Once QA lead/Manager review defect and change it status to open and assign it to Developer.
  •  Fixed/ Retest: Once defect got fixed from Developer and assign it to QA member.
  •  Re-OPenedIssue after retesting the defect. In this member assign defect to Developer again.
  •  Rejected: There will be two reasons to reject defect from Developer.
  •  Duplicate Defect: Same defect has been raised by another QA member
  •  Not a Defect: Raised defect is not related to Requirement.
  •  Deferred: Fix will be given in further phases.
  •  Closed: Once the retested defect meets user requirement, QA member will close the defect.
 5) Where Test cases will be written in QC?
 
Test cases design will be done in Test Plan.
 
6) Where Test cases will be executed?
 
When tested application is migrated to QA Environment, then Test cases corresponding application will be pulled to Test lab and will be executed.
 
7. Name different requirement documents?
 
  • SRS(System requirement specification)
  • BRD (Business requirement document)
  • TRD (Technical Review document)
  • User Manuals.
  • Use cases
  • User stories(only in agile)
 8. What is meant by test scenario and test case?
 
Test scenario is “what to be tested and test case “How to be tested”. Test scenario is simply one liner statement Which explains about What to test. Whereas Test case gives detailed information about Pre-condition. What to test ,test description, design steps and expected results.
 
9. At What condition automation is preferred?
 
After completion of manual testing (application is in Stable), if any regression/repeated test cases going to execute, in that case Automation is preferred.
 
10) System and E2E testing levels will fall into what method?
 
System and E2E will come into Black Box Testing
 
11) What is meant by alpha and beta testing?
 
In Alpha, Application/Software is under Developer environment. Here we will shows case the application as per the user requirements.
 
Where in Beta, Application/Software is under user environment and Developer will send only few feedbacks to support UAT.
 
12) Name the roles and responsibilities of product owner in Agile?
 
Roles for product owner are:
 
He/She prioritize the Sprint duration.
 
He/She prioritize the User stories for the particular Sprint.
 
13) What things do we discuss in Retrospective meeting in Agile?
 
      Below things are discussed in Retrospective meetings.
 
  • Things went well.
  • Things not went well
  • Things need to be updated.
14) Name few SDLC types
 
SDLC types:
 
  • Water fall.
  • V-Model.
  •  Iterative.
  •  Spiral.
  •  Big bang.
  •  Agile etc.
15) Name types of integration testing?
 
  • Top- Bottom Approach.
  •  Bottom- Up Approach.
  •  Sandwich Approach.
  •  Big Bang Approach.

What is testing tools?

Before knowing Software testing, we need to know what is meant by the word “TEST”.

In real world, we see TEST as

  • Test exam: Conducting an exam to check the students percentage of pass/fail.

Action items: As per the questions given, students answer to the corresponding questions (which means every question should have expected answers.)

  • Test Lab Reports: Here as per the sample given, will go a process of treatment as per the reports.

Action Items: As per the reports will contact doctor and do the corrective actions.

  • Test Drive: Here will check performance (speed, mileage, engine pickup, etc…,) of the driven vehicle.

Action Items: Here we will check whether the vehicle is as per our requirements or not.

  • Test Match: Everyone knows what is meant by Test Cricket, where we mainly focuses on player performance like stamina, sustain, resistance, patience etc…,

Action Items: Player will be IN the team if his/her performance is good.

Now derive, definition of Software Testing from real-time examples:

Software testing is a process of identifying the issues and do the corrective actions and provide quality product of an application/product/software.

Aim: Is to focus on user requirements, needs and expectations of the user/customer.

Job: To find the failures in the application and do the corrective actions as per user needs.

Testing Tools Training in Hyderabad

Testing Tools:

For doing testing in this advanced world, we will use some testing tools in order to fasten the work, bring system into stable, check in multiple applications simultaneously, provide continues reports to user for easy to understand, etc…,

Some of the well-known testing in market are:

  1. TestComplete
  2. Selenium
  3. LeanFT
  4. Tosca
  5. UFT
  6. Rational Functional Tester

 

testing tools in market

 

Automation tools:

Nowadays, development pactices changes frequently and many updates are proposed which aims to provide quality, customer expectations, productivity etc…, and the same should be happen when comes to test automation.

The main Automation tools available in current market are:

  1. UFT
  2. Selenium
  3. Katalon Studio
  4. TestComplete
  5. Rational Software etc…,

 

Automation Testing

Automation Tools

What is meant by Manual Testing?

Basically Software Testing is divided into two types:

  1. Manual Testing
  2. Automation Testing

Manual Testing vs Automation Testing

Manual Testing will be defined as:

Software testing where QA team manually executes written Test cases without any automation involved will be considered it as Manual Testing.

Aim of Manual Testing to find/identify the bugs/defects in the application/product/software using written Test cases and focus on delivery quality application / product / software which meets ccustomer/userneeds.

Manual Testing

indepths of Manual Testing

Why Manual Testing needed?

  • Whatever we expect should come:

Example: When we try to launch https://www.gmail.com login page, it should show me the same, but if it opens https://www.yahoomail.com which is not as expected. Hence there should be a team (QA) to check whatever user needs should come.

Why manual Testing

  • Application behavior varies from one to many users, so it should work as expected when deals with one to many:

Example: Generally we have noticed server slow / down when we try to book railway tickets at Tatkal timings and as well as when server publish exam result. This is mainly due to load on the server. So there should be a team (QA) to check the server performance with one to many user.

  • Application in different places should work without any dependency:

 

Example: # Many people uses different devices like IPhone, Moto, Samsung, MI etc…,

    # Not only this, people uses many browsers like Mozilla, Chrome, IE, Safari etc…,

    #adding to this, many people uses many Operating Systems like Windows, Linux, MAC, Android, IOS etc…,

Hence application should behave same irrespective of devices / Browsers / Operating Systems which means a team (QA) should require to support this checks.

Manual Vs Automation:

As the name Manual suggests, executing the application with respect to written Test Cases. And for Automation, will execute the application with respect to written Test scripts. However we have many difference between Manual and Automation.

Manual

  • Investment required as human are involved.
  • Time Consuming.
  • Less reliable, not accurate due to human errors.
  • Suitable at Exploratory Testing, Usability Testing and Ad-hoc testing.

Automation

  • Investment required on automation tools.
  • It will be faster than manual.
  • More reliable as Automation tools involve.
  • Suitable at regression testing, Load Testing, repeated testing and performance testing.

Manual Testing vs Automation testing

Software Testing Life cycle(STLC):

As a basic example, a human life will start as Infant, later goes through distinct ages to gradually grow and matured to grand age. Similarly, Software Testing Life Cycle has different phases to go though and gives us a Quality Product.

Phases:

  1. Test Requirement ANalysis.
  2. Test planning.
  3. Test case Design and Development.
  4. Test Environment Setup.
  5. Test Execution.
  6. Test Closure.
Software Development Life Cycle(SDLC):

Software Development Life Cycle involves entire product members to design, develop and gives the quality product as per the customer needs.

It is a conceptual and long-term view of software product to be delivered.

Types of SDLC models in real market:
  1. Waterfall Model.
  2. V-Model.
  3. Iterative Model.
  4. Spiral Model.
  5. Big-Band Model.
  6. AGILE Model etc…,

Manual testing interview questions and Answers

Testing Tools training in Hyderabad

Kosmik Provides Testing Tools training in Hyderabad(ClassRoom & Online). We are providing lab facilities with complete real-time training. Training is based on complete advance concepts. So that you can get easily “hands-on experience”. We will give 100% job assistance.

Creating Keyword & Frameworks with Selenium | Selenium testing KPHB

Selenium testing KPHB

Creating Keyword & Hybrid Frameworks

Frameworks assist to structure our code and maintenance easy. Without frameworks we could place total our code. Which is neither reusable nor readable and data in same place. To produce beneficial outcomes for using of frameworks. Like increase code reusage, higher portability, reduced script maintenance cost etc

There are three types of frameworks created by Selenium WebDriver to automate manual testcases

Data Driven Test Framework

Keyword Driven Test Framework

Hybrid Test Framework

 

Data Driven Test Framework

 

Test data is produce from some external files. Like excel, csv, XML or some database table in data driven framework.

 

Keyword Driven Test Framework

 

All the operations and instructions are register in some external file. Like excel worksheet in keyword driven test framework. Here is how the fulfilled framework looks like

 

2

 

If you can see it’s 5 steps of framework. Let’s refer it step wise in depth 

Selenium testing KPHB

Step 1) the driver script Execute.java can call ReadKosmikExcelFile.java

 

ReadKosmikExcelFile.java has t0 read data from an excel for POI script 

 

Step 2) ReadKosmikExcelFile.java should read data from TestCase.xlsx

 

Here how the sheet focus like:

 

3

 

Observe to the keywords written in excel file, the framework can perform the operation on UI.

 

For example, we want to click a button ‘Login’. State, our excel should have a keyword ‘Click’. Now the AUT will have hundreds of button on a page. To know a Login button, in excel input Object Name as login Button & object type as name. The Object Type will be xpath, name css or any other value

 

Step 3) ReadKosmikExcelFile.java can form this data to the driver script Execute.java

 

Step 4) for all our UI web elements we want to create an object repository.  Where should we place their element locator (like xpath, name, css path, class name etc.)

 

4

 

Execute.java could read the entire Object Repository and store in a variable

 

To read this object repository we want a Read Object class. Which has a getObjectRepository method to read it.

 

5

 

Step 5) the driver will pass the data from Excel & Object Repository to UIOperation class

 

UIOperation class has functions to perform actions. State to keywords like CLICK, SETTEXT etc mentioned in the excel

 

UIOperation class is a java class which has to implementation of the code. To perform operations on web elements

 

6

 

The complete project should focus like:

 

7

 

Installation of Selenium IDE | Selenium Coaching Institute in KPHB

 

Selenium Coaching Institute in KPHB

Step 1 – Install Java on your computer

 

First we have to Download and install the Java Software Development Kit (JDK) 

1

2

This JDK version comes bundled with Java Runtime Environment. So you do not need to download and install the JRE separate.

 

Step 2 – Install Eclipse IDE

 

Download “Eclipse IDE for Java Developers“. Be sure to choose correct between Windows 32 Bit and 64 Bit versions.

3

You should able to download ZIP file named “eclipse-java-juno-SR1-win32-x86_64”

4

Inside ZIP file, there is an “eclipse” folder which contains all the application files. You can extract the “eclipse” folder anywhere you want in your PC. But for this tutorial, extract it to your C drive.

5

Unlike other popular software, no installation is must to use eclipse.

 

Step 3 – Download the Selenium Java Client Driver

 

You can download the Java Client Driver. You could find client drivers for other languages there, but only choose the one for Java.

6

This download comes as a ZIP file named “selenium-2.25.0.zip”. For simplicity, extract the contents of this ZIP file on your C drive. So that you would have the directory “C:\selenium-2.25.0\”. This directory includes all the JAR files that we would later import on Eclipse.

 

Step 4 – Configure Eclipse IDE with WebDriver

 

  1. Launch the “eclipse.exe” file inside the “eclipse” folder that we extracted in step 2. If you followed step 2 correct, the executable should be locate on C:\eclipse\eclipse.exe.
  2. When asked to select for a workspace, just accept the default location.

7

             3.Create a new project through File > New > Java Project. Name the project as “newproject”.

8

A new pop-up window will open enter details as follow

  1. Project Name
  2. Location to save project
  3. Select an execution JRE
  4. Select layout project option
  5. Click on finish button

9

4.in this step,

  1. Right-click on the new created project and
  2. Select New > Package, and name that package as “newpackage”.

10

A pop-up window will open to name the package,

  1. Enter the name of the package
  2. Click on finish button
  3. Create a new Java class under newpackage by right-clicking on it. And then selecting- New > Class, and then name it as “MyClass”. Your Eclipse IDE should look like the image below.

When you click on Class, a pop-up window will open, enter details as

  1. Name of the class
  2. Click on Finish button

 

11

 

  1. Create a new Java class under newpackage by right-clicking on it. And then selecting- New > Class, and then name it as “MyClass”. Your Eclipse IDE should look like the image below.

12

When you click on Class, a pop-up window will open, enter details as

  1. Name of the class
  2. Click on Finish button

13

 

This is how it looks like after creating class.

14

Now selenium WebDriver’s into Java Build Path

In this step,

  1. Right-click on “newproject” and select Properties.
  2. On the Properties dialog, click on “Java Build Path”.
  3. Click on the Librariestab, and then
  4. Click on “Add External JARs..”

15

When you click on “Add External JARs…” It will open a pop-up window. Select the JAR files you want to add.

16

After selecting jar files, click on OK button.

17

  1. Add all the JAR files inside and outside the “libs” folder. Your Properties dialog should now look like to the image below.

18

Selenium Coaching Institute in KPHB

 

7.Finally, click OK and we are complete importing Selenium libraries into our project.

Why Maven & Jenkins? | Selenium Training in Kukatpally

Selenium Training in Kukatpally

What is Jenkins?

 

The Jenkins is the most important open source continuous process of combine with another tool. It is cross platform and it can be use on Windows, Linux, Mac and Solaris environments. It is compose in Java. Jenkins most important usage to check the progress any job which can be any application state.  It stimulates preconfigured actions when an individual step occurs in tasks.

 

The Jenkins allows us to take 1 more step further, and allow us to automate this execution of test cases. A little more work, you can configure such that your tests are execute every time after deploys a new build. Checks in code Jenkins build a execute unit tests,deploys the application to test environment. Jenkins builds and then executes your tests on the new deployed application. This is essential the CI process that others have mentioned. At this point, the only thing that you need to real worry is the writing of your test automation code. The gathering of test results post-execution. All other processes have been automated through the use of Jenkins

 

What is Maven?

 

The word Maven means “accumulator of knowledge” in Yiddish. It is a build automation tool used main for Java projects. Its particular two features of build for software. First, it mark out how software is build and second, it mark out its province controlled by another.
The Maven Is Powerful Java project management and erect management tool. That means we can manage java project builds effort use of maven. The Maven can help you to reduce your project and build management time and efforts. It is fine to manage project manual if it is small. But if project is large or there are many projects then it is too hard for developer to manage each of them manual.

 

 You can setup all those things which required to run your project code Independent. Maven provides common platform to generate source code, compile and package code.

 

Why Maven & Jenkins?

 

Apache Maven offers support for manage the full lifecycle of a test project. Maven is use to define project structure, province build and test management. Use of pom.xml you can configure dependencies needed for build test and run code. The maven directs downloads the necessary files from the repository while build the project.

 

Important Features of Jenkins

 

  • Jenkins produces the list of all changes done in repositories like SVN.
  • Direct links to the latest build or failed build in Jenkins for easy communication.
  • Jenkins can be configure to email the content of the status of the build.
  • To configure the various tasks on Jenkins is easy.
  • Jenkins can be configure to run the automation test build on Test NG after each build of SVN.
  • Jenkins can be configure to distribute the build on many machines
  • Jenkins documents the details of a jar version. A jar and map for build jar numbers.
  • Third party plug in can be configure in Jenkins to use features and extra functionality

 

Important Features of Maven

 

  • Get a new project or content started in seconds. Simple project setup that follows best performance of an activity in Maven
  • Consistent usage across all projects means no ramp up time for new developers come to project
  • Senior dependency organization includes automatic update, dependency closures
  • Able to easy work with many projects at the same time
  • A large and developing repository of libraries and metadata to use out of the box
  • Largest Open Source projects for real-time availability of their latest releases

 

Selenium Training in Kukatpally

 

  • Extensible, with the ability to easy write plug in Java or script languages
  • Instant access to new aspects with little or no extra configuration
  • Ant tasks for dependency directorate and deployment outside of Maven