Thursday 15 July 2021

Top 80 Advanced Selenium UI-Automation Advanced Interview Questions 2021?

 

Check Selenium Interview questions from 1 to 10 below:


Check Selenium-SDET-UIAutomation Questions set 11 to 20:
Qus Set - 11 to 20

Check Selenium-SDET-UIAutomation Questions set 21 to 30:
 
Check Selenium-SDET-UIAutomation Questions set 31 to 40:

 Question Set 31-40  

Check Selenium-SDET-UIAutomation Questions set 41-50:

Q&A Set 41-50

Check Selenium-SDET-UIAutomation Questions set 51-70:

Q&A Set 51-70

 71. What is default time for implicit and explicit wait?

Implicit wait default time is zero.
Explicit wait default time is 500 ms

72. What is remote WebDriver client?

ChromeOptions chromeOptions = new ChromeOptions();

chromeOptions.setCapability("browserVersion", "67");

chromeOptions.setCapability("platformName", "Windows XP");

WebDriver driver = new RemoteWebDriver(new URL("http://www.example.com"), chromeOptions);

driver.get("http://www.google.com");

driver.quit();


73. What is the use of Driver in Selenium?

Responsible for controlling the actual browser. Most drivers are created by the browser vendors themselves. Drivers are generally executable modules that run on the system with the browser itself, not on the system executing the test suite.

74.What are the new features in Selenium 4? VERY IMP 

Click Here For Detail Answer

75. Explain some of the strategy to handle CAPTCHA?

There are two primary strategies to get around CAPTCHA checks:

  • Disable CAPTCHAs in your test environment
  • Add a hook to allow tests to bypass the CAPTCHA

76. What is page load strategy in Selenium?

Click Here For Answer

77. What is Relative Locators?

Selenium 4 brings Relative Locators which are previously called as Friendly Locators. This functionality was added to help you locate elements that are nearby other elements. The Available Relative Locators are:

  • above
  • below
  • toLeftOf
  • toRightOf
  • near
78. What is the use of withTagName()?

indElement method now accepts a new method withTagName() which returns a RelativeLocator.

79. How to perform parallel test with cross browser using docker?


80.How to create a custom profile ?

FirefoxProfile profile = new FirefoxProfile();

FirefoxOptions options = new FirefoxOptions();

options.setProfile(profile);

driver = new RemoteWebDriver(options);


BONUS.How do you achieve synchronization in WebDriver?

We can achieve synchronization either by using Static Wait or Dynamic Wait.
Static wait : Thread.sleep(): not good practice to use static wait
Dynamic wait: This can be achieved by using Implicit wait, Explicit Wait, Fluent Wait

****************************************************

Check Selenium Interviewquestions from 1 to 10 below:


Check Selenium-SDET-UIAutomation Questions set 11 to 20:
Qus Set - 11 to 20

****************************************************

REVISION:

36.  How to launch batch file from Selenium WebDriver?

 Process batch = Runtime.getRuntime.exec("path of the batch file");

37. How to run selenium test from command line?

java -classpath ".;selenium-server-standalone-2.33.0.jar" SampleClass

38. What is the name of the super interface of the Webdriver?

Ans: SearchContext.

39. Explain some of the strategy you have followed while using xpath?

Click here for answer

40. How to execute the testng test suite from the command line?

Ans: java -cp “C:\AutomationReinvented\testng \lib\*;C:\AutomationReinvented\testng\bin” org.testng.TestNG testng.xml

TRANING VIDEOS AVAILABLE with Doubt Session @4500/-(ONLY API) and 6500/- (API+UI)

Check Below Links for Course Content (whatsapp 9619094122)

REVISION:

23. How to set the size of the window in selenium?

driver.manage().window().setSize(new Dimension(1024, 768));

24. How to fetch the size of window in Selenium?

Dimension size = driver.manage().window().getSize();
int width = size.getWidth();
int height = size.getHeight();

25. How to maximize the window in selenium?


driver.manage().window().maximize();

26. How to drag and drop from source to destination?

  ANS:    Click Here For Answer
     
27. How to perform keyboard actions in selenium?

By using Robot class as below:
Robot robo = new Robot();
robo.keyPress(KeyEvent.VK_ENTER);

28. How to get all cookies and with name of the cookie?

driver.manage().getCookies();
driver.manage().getCookieNamed("APISID");

29. How to delete all cookies and with name of the cookie?

Ans: Click Here For Answer

30. How to add a cookie?

 Cookie cookie1 = new Cookie("test2", "cookie2");
 driver.manage().addCookie(cookie1);


Check Selenium-SDET-UIAutomation Questions set 21 to 30:
 
Check Selenium-SDET-UIAutomation Questions set 31 to 40:

 Question Set 31-40  

Check Selenium-SDET-UIAutomation Questions set 41-50:

Q&A Set 41-50


Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session

TRANING VIDEOS AVAILABLE with Live Doubt Session @4500/-(course-1 below,API TRaining Videos With ClassNotes and Coding Set) and 6500/- (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122



Entire course content can be found below:  COURSE CONTENT

  • To check API related topics and interview tips check below and keep reading:

    Most Asked API Question For SDET

    Want to learn more? ...Check below link for more interview question:
     
     

 API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

SeleniumWebdriver Automation Testing Interview Questions:

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

Sunday 4 July 2021

Java Coding Interview Question for Automation Testing / QA / SDET?




Java Interview question Set-1:
SET-01 1-10

Java Interview question Set-2:

SET-02 10-20

Java Interview question Set-3:

SET-03 21-30


1. Find the second largest in an ARRAY?

public class firstsecodlargest {

public static void main(String[] args) {

int[] arr = {1,2,3,4,5,6};

int firstlargest=0;

int secondlargest=0;

int i=0;

int n= arr.length;

for (i=0;i<n;i++) 

{

if (arr[i]>firstlargest){

secondlargest=firstlargest;

firstlargest=arr[i];

}

}

System.out.println(firstlargest + "  " + secondlargest);


}}


2. How to do sorting in HashMap?

Click Here For Answer


3. How to find maximum and minimum in an ARRAY?


class maxminarray {

static int findmax[] = {10, 324, 45, 90, 9808};

static int max()

{

int i;

int max = findmax[0];

for (i=1;i<findmax.length;i++)

if (findmax[i] > max)

max = findmax[i];

return max;

}

static int min()

{

int i;

int min = findmax[0];

for (i=1;i<findmax.length;i++)

if (findmax[i] < min)

min = findmax[i];

return min;

}

public static void main(String[] args) {

System.out.println("largest element is:" + max() + "\n" + "smallest element is:" + min());

}

}


4. How to Add/Join/Combine two list?

Click Here For Answers


5. Give an example of Overriding?


package LearnJavaCoding;


 class overriding {

public void test(String name) {

System.out.println("testone");

}}

class child extends overriding{

protected void test() {

//super.test();

System.out.println("testtwo");

}

}

class testthree{

public static void main(String args[]) {

child chg = new child();

chg.test();

}}


6. How to find duplicate element in Array?


Click Here For Answer


7. How to check if two strings are Anagrams?


public class Anagrams {

 

    /* function to check whether two strings are  

    anagram of each other */

    static boolean areAnagram(char[] str1, char[] str2) 

    { 

        // Get lenghts of both strings 

        int n1 = str1.length; 

        int n2 = str2.length; 

 

        // If length of both strings is not same, 

        // then they cannot be anagram 

        if (n1 != n2) 

            return false; 

 

        // Sort both strings 

        Arrays.sort(str1); 

        Arrays.sort(str2); 

 

        // Compare sorted strings

        for (int i = 0; i < n1; i++) 

            if (str1[i] != str2[i]) 

                return false;

        return true; 

    } 

 

    /* Driver program to test to print printDups*/

    public static void main(String args[]) 

    { 

        char str1[] = { 't', 'e', 'w', 't' }; 

        char str2[] = { 't', 't', 'e', 'w' }; 

        if (areAnagram(str1, str2)) 

            System.out.println("The two strings are"

                              + " anagram of each other"); 

        else

            System.out.println("The two strings are not"

                              + " anagram of each other"); 

    } 

} 


8. How to reverse a string without using function?


Click Here For Answer


**********************

Check Selenium Interviewquestions from 1 to 10 below:


Check Selenium-SDET-UIAutomation Questions set 11 to 20:
Qus Set - 11 to 20

Check Selenium-SDET-UIAutomation Questions set 21 to 30:
 
Check Selenium-SDET-UIAutomation Questions set 31 to 40: 

 Question Set 31-40  

Check Selenium-SDET-UIAutomation Questions set 41-50:

Q&A Set 41-50 

**********************


9. How to find a number is Palindrome or not?


public static void main(String args[]){  

  int r,sum=0,temp;    

  int n=454;//It is the number variable to be checked for palindrome  

  

  temp=n;    

  while(n>0){    

   r=n%10;  //getting remainder  

   n=n/10;

   sum=(sum*10)+r;     

  }    

  if(temp==sum)    

   System.out.println("palindrome number ");    

  else    

   System.out.println("not palindrome");    

}  

}  


10. How to check a number is prime or not?


Click Here For Answer


Java Interview question Set-1:
SET-01 1-10

Java Interview question Set-2:

SET-02 10-20

Java Interview question Set-3:

SET-03 21-30

**********

Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

**********


*************************************************

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions







All Time Popular Posts

Most Featured Post

API Status Codes with examples for QA-Testers

  🔺 LinkedIn: https://www.linkedin.com/in/sidharth-shukla-77b53145/ 🔺 Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 🏮In API testing, it...