How you can handle the list box?
Answer:Using selenium Select class &it's methods like selectByValue, selectByIndex etc.
👍8🥰1
 What details are included in the defect report?
Answer- A defect report consists of Defect ID, Description of the defect, Feature Name, Test Case Name, Reproducible defect or not, Status of the defect, Severity, and Priority of the defect, Tester Name, Date of testing of the defect, Build Version in which the defect was found, the Developer to whom the defect has been assigned, name of the person who has fixed the defect, Screenshots of a defect depicting the flow of the steps, Fixing the date of a defect, and the person who has approved the defect.
👍10
What is Severity and Priority with examples ?Answer: Every type of software Bug need to categories as per its impact on software functionality is called “severity” and it need to be resolved as per its business value impact called “priority”.
**1. High Severity and High Priority:**
Example: banking application has a login page where the user is authenticated the ‘Login’ button on the login form is not-clickable. After filling in the login details, the user is not able to click the ‘Login’ button and hence the user is not able to log in, whole application is blocked and none of the functions can be accessed by the user and need urgent fix.
**2. Low Severity vs. High Priority**
Example: On the user home page after login, banking application shows all the options of – Deposits, Transfer, Account Summary etc. In our example, the spelling of ‘Transfer’ is misspelt as ‘Transfre’. This error has no effect on the functionality of the application because the user is able to click and perform a transfer successfully but the priority is High since it is related to business and needs to be fixed as soon as possible.
**3. High Severity vs. Low Priority:**
Example: Some older browsers render a webpage with several faults. The logo will not load, the text will jumble, and the graphics will be overly pixelated. The severity of the problem is significant since it affects both product functionality and user experience. However, because the issue primarily affects outdated browsers, it won't affect a big number of people. As a result, bug priority is low.
**4. Low Severity vs. Low Priority:**
Example: The ‘Help’ section of the banking website has a subsection, whose theme does not match with the whole website. This defect is not hampering the website functionality, also not many users will access this particular section. Hence, this defect falls under the category of Low Severity and Low Priority.
👍12
Write a program to print the series of- 1
12
123
1234
12345 Answer: public class Main
{
public static void main(String[] args)
{

for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.println();
}


}
}
👍7👏2
Method Overloading in Java: Method overloading allows the method to have the same name which differs on the basis of arguments or the argument types. It can be related to compile-time polymorphism. Example: public class Main
{
int add(int n1, int n2)
{
return n1+n2;
}
int add(int n1, int n2, int n3)
{
return n1+n2+n3;
}
public double add(double a , double b)
{
return (a + b);
}
public static void main(String[] args)
{

Main obj = new Main();
System.out.println("Sum of two numbers: "+obj.add(20, 20));
System.out.println("Sum of three numbers: "+obj.add(20, 20, 20));
System.out.println("Sum of two double numbers: "+obj.add(20.50,20.50));


}
} Output: Sum of two numbers: 40
Sum of three numbers: 60
Sum of two double numbers: 41.0
👍7
Method Overriding in Java: Inheritance in java involves a relationship between parent and child classes. Whenever both the classes contain methods with the same name and arguments or parameters it is certain that one of the methods will override the other method during execution. The method that will be executed depends on the object.

If the child class object calls the method, the child class method will override the parent class method. Otherwise, if the parent class object calls the method, the parent class method will be executed. Example: class Demo
{
void show()
{
System.out.println("Demo class method");
}
}
class Main extends Demo
{
void show()
{
super.show();
System.out.println("Main class method");
}
public static void main(String args[])
{
Demo ob = new Main();
ob.show();
}
} Output: Demo class method
Main class method
👍7👏2
Write a program to print the series of- 1
12
123
1234
12345 Answer: public class Main
{
public static void main(String[] args)
{

for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.println();
}


}
}
👍12🤯1
Write a program to print the series of 1
23
456
78910
1112131415 Answer: public class Main
{
public static void main(String[] args)
{
int k=1;
for(int r=1;r<=5;r++)
{
for(int c=1;c<=r;c++)
{
System.out.print(k);
k++;
}
System.out.println();
}
}
} Output: 1
23
456
78910
1112131415
👍7🤯3👏2
**Reverse each word’s characters in string** Answer: import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter Original string : ");

String originalStr = s.nextLine();
s.close();

String words[] = originalStr.split("\\s");
String reversedString = "";

for (int i = 0; i<words.length; i++)
{
String word = words[i];
String reverseWord = "";
for (int j = word.length()-1; j>=0; j--)
{
reverseWord = reverseWord + word.charAt(j);
}

reversedString = reversedString + reverseWord + " ";
}

// Displaying the string after reverse
System.out.print("Reversed string : " + reversedString);
}
} Output: Enter Original string : Today's Date is 23 June 2022
Reversed string : s'yadoT etaD si 32 enuJ 2202
👍13👏3
**Reverse the words in string** Answer: import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter Original string : ");

String originalStr = s.nextLine();
s.close();

String words[] = originalStr.split("\\s");
String reversedString = "";

//Reverse each word's position
for (int i = 0; i < words.length; i++)
{
if (i == words.length - 1)
reversedString = words[i] + reversedString;
else
reversedString = " " + words[i] + reversedString;
}

// Displaying the string after reverse
System.out.print("Reversed string : " + reversedString);
}
} Output: Enter Original string : Today's Date is 23 June 2022
Reversed string : 2022 June 23 is Date Today's
👍15👏1
can we overload main() method in java? Answer:Yes, we can overload main() method. A Java class can have any number of main() methods. But it should have one main() method with signature as “public static void main(String[] args)” to run. Example: public class Main
{
// main method that takes an int argument
public static void main (int i)
{
System.out.println ("Inside overloaded main with Int: " + i);
}

// main method that takes a double argument
public static void main (double d)
{
System.out.println ("Inside overloaded main with double: " + d);
}

public static void main (String s)
{
System.out.println ("Inside overloaded main with string: " + s);
}

public static void main(int num1, int num2)
{
System.out.println("Inside overloaded main with Sum of 2 Integer:"+(num1 + num2));
}

public static void main (String[]args)
{
System.out.println ("Inside Main Method");
main(20);
main(10.20);
main("CodingAnywhere");
main(10,20);
}
} Output: Inside Main Method
Inside overloaded main with Int: 20
Inside overloaded main with double: 10.2
Inside overloaded main with string: CodingAnywhere
Inside overloaded main with Sum of 2 Integer:30
👍19🥰1👏1
**Selenium Automation Framework**
👏1