Java Tutorial Day 3 |Loops | Nested for loop|Enhanced loop|Terminate loop| break|Selenium WebDriver

Опубликовано: 25 Октябрь 2020
на канале: total-qa
235
3

Day1:
------------
JAVA Introduction

Java Execution Flow

Variables
DataTypes

Conditional Statements

Examples:

Day1 Video Link:
   • Java Tutorial Day 1 |Introduction|Exe...  
Github Repo Link:
https://github.com/SELENIUMJAVATutorial
-------------------------------------------------------------------------------------------------------------------------
Day2:
------------
Array is a datastructure useful to store multiple values of similar datatype
There are two types of array.
1. Single Dimensional Array
2. Multi Dimensional Array

Day2 Video Link:
   • Java Tutorial Day 2 |Arrays | 1D Arra...  
Github Repo Link:
https://github.com/SELENIUMJAVATutori...
-------------------------------------------------------------------------------------------------------------------------

Day3:
---------------
Loops:
for
nested for loop
Enhanced for loop
while
do-while

Loops will helps us to perform an activity for specified number of times.

Example:
Printing selenium 10 times

syso("selenium");
syso("selenium");
syso("selenium");
syso("selenium");
syso("selenium");
syso("selenium");
syso("selenium");
syso("selenium");
syso("selenium");

Syntax of for Loop:
----------------------

for(initialization;condition;increment/decrement)
{
//block of statement

}


for(int i=0; i10;i++) //i = i+1 i = 0+1
{
syso("selenium");
}

0,1,2,3,4,5,6,7,8,9

Syntax of Nested for Loop:
-------------------------------------------
A for loop inside another for loop is called Nested Loop.
This will be helpful in the case of reading the tabular data in the webpage and also to read the data from the

XLS/XLSX where the rows and cols are available.

for(initialization;condition;increment/decrement)
{
//block of statement

for(initialization;condition;increment/decrement)
{
//block of statement

}
}


Using the break in the case of Loops:
---------------------------------------
The break statement helps the loop to terminate the java program immediately and control goes to the next statement

following the loop.


Syntax of Enhanced for Loop:
----------------------------------
Enhanced for loop is useful in the specific scenario's when there is no possibility of retrieving the elements from the

collection without using the index.

for(data_type variable : arrayName | collection(List,Set,Map))
{

}

Syntax for while loop:
-----------------------
initialization;

while(condition)
{
//block of statements

increment/decrement;
}

Syntax of do-while loop:
----------------------------
initialization;

do{
//block of statements
increment/decrement;
}while(condition);

Diff between while and do- while is even if the condition is false it executes the do-while loop once.

Check out the blog as well http://total-qa.com
PlayList Details:
SOAPUI:
   • SOAPUI  
JIRA:

SELENIUM INTERVIEW QUESTIONS:
   • Selenium Interview Questions  
PAGE OBJECT MODEL PRINCIPLES:
   • PageObjectModel  
JENKINS:
   • JENKINS  
REST API TUTORIAL:
   • REST API TUTORIAL  
JAVA:
   • Java  
SELENIUM WEBDRIVER:
   • Selenium WebDriver  
XPATHTUTORIAL:
   • Xpath Tutorial  
CssSelector:
   • Css Tutorial  
GITHUB:
   • GITHUB