For-loop in Java
class ForLoop {
public static void main(String[] args) {
int c;
for (c = 1; c <= 10; c++) {
System.out.println(c);
}
}
}
Azure, RPA, AI, Selenium, Angular, API
class ForLoop {
public static void main(String[] args) {
int c;
for (c = 1; c <= 10; c++) {
System.out.println(c);
}
}
}
import java.util.Scanner;
class IfElse {
public static void main(String[] args) {
int marksObtained, passingMarks;
passingMarks = 40;
Scanner input = new Scanner(System.in);
System.out.println(“Input marks scored by you”);
marksObtained = input.nextInt();
if (marksObtained >= passingMarks) {
System.out.println(“You passed the exam.”);
}
else {
System.out.println(“Unfortunately you failed to pass the exam.”);
}
}
}
import java.util.Scanner;
class NestedIfElse {
public static void main(String[] args) {
int marksObtained, passingMarks;
char grade;
passingMarks = 40;
Scanner input = new Scanner(System.in);
System.out.println(“Input marks scored by you”);
marksObtained = input.nextInt();
if (marksObtained >= passingMarks) {
if (marksObtained > 90)
grade = ‘A’;
else if (marksObtained > 75)
grade = ‘B’;
else if (marksObtained > 60)
grade = ‘C’;
else
grade = ‘D’;
System.out.println(“You passed the exam and your grade is ” + grade);
}
else {
grade = ‘F’;
System.out.println(“You failed and your grade is ” + grade);
}
}
}
char cAlpha = ‘A’;
do {
System.out.println(cAlpha );
cAlpha ++;
} while (cAlpha <= ‘Z’);
char cAlpha = ‘a’;
while (cAlpha <= ‘z’) {
System.out.println(cAlpha);
cAlpha ++;
}
class PrintAlphabets
{
public static void main(String args[])
{
char chAlpha;
for( chAlpha= ‘a’ ; chAlpha<= ‘z’ ; chAlpha++ )
System.out.println(chAlpha);
}
}
How to implement Multiplication program in java:
import java.util.Scanner;
class TableForMultiplication
{
public static void main(String args[])
{
int i, j;
System.out.println(“Enter an integer to display it’s multiplication table…”);
Scanner in = new Scanner(System.in);
i = in.nextInt();
System.out.println(“Multiplication table of “+i+” is :-“);
for ( j = 1 ; j <= 10 ; j++ )
System.out.println(i+”*”+j+” = “+(i*j));
}
}
How to connect sqlserver using QTP scripts?
Dim connectionMS, recordsetMS
Set connectionMS = createobject(“adodb.connection”)
Set recordsetMS =createobject(“adodb.recordset”)
connectionMS.open”Driver={SQL Server};server=YourSqlServer;uid=YourUserName;pwd=YourPassword;database=dbname”
recordsetMS.open “select * from tablename”,connectionMS
databaseValue = recordsetMS.fields.item(0)
msgbox databaseValue
Set connectionMS = nothing
Set recordsetMS = nothing
Annotation – TestNG’s test case priority
To schedule priority over multiple test cases, TestNG uses this coding feature called “annotation”
e.g.
@Test (priority = 1)
@Test (priority = 2) etc in the code
For quick summary on TestNG – please check my TestNG quick summary blog
Apache Mahout is library of machine learning algorithams, helps in clustering and Clustering allows the system to group various entities into separate clusters or groups based on certain characteristics or features.
Mobile device management (MDM) is a type of security software.
MDM is used to manage , monitor, and secure mobile devices that are deployed across multiple mobile service providers,& multiple mobile operating systems.
Master data management (MDM) is a method of enabling an enterprise to link all the critical data to one file (a master file) which can provide a common point of reference.
When properly done, MDM manages data sharing among personnel and departments.
1. Performance testing – The main purpose of Performance testing is to arrive the benchmark & baseline of the system behavior (e.g response time) under normal/moderate load. This test will help performance engineer to analyse how does the application behave under normal conditions.
2. Load testing – here load will be constantly and steadily increased over a given period of time. i.e the constant load applied for a constant period of time. For example a load of 100 users are applied for 15 min.
3. Stress test – it is meant to push the system beyond the normal load limits or extreme conditions. This test is to make sure the servers don’t crash or what point it crashes. Stress test will verify the breaking point of the system or how much load, system can withstand.
For example a load of 100 users are applied for 15 min and then 150 users load is applied for next 15 min. then 200 users load is applied for next 15 min. Verify at what point system stopped to respond.
4. Endurance testing – for easy understanding, I would say it is a “Load testing on extended period” to make sure web servers are performing longer period of time. For example a load of 100 users are applied for 48 hours
Note: Once the performance testing is completed successfully, tester can assume the performance requirements are met and he can start load testing. After that Stress testing if required.
Load testing tools in the market are
1) HPE LoadRunner is from Hewlett Packard Enterprise.
2) JMeter – Apache JMeter. It is a Java based performance testing tool works on web communication layer (HTTP)