Sunday, July 2, 2017

[INTERVIEW] Selenium basic to advance level Questions - Part 1

Below are the Selenium Webdriver question I faced during my Interview with several companies -

Q1. What is Synchronization in selenium?
Click to view Answer

Q2. What is the difference between Thread.Sleep and selenium.setSpeed?
Click to view Answer

Q3. How to perform a double click on an element or any context menu?
Click to view Answer

Q4. How to use Maven for server repository?
Help me in solving this question

Q5. How to use AutoIt for file upload wit a relative path? 
Help me in solving this question

Q6. How to get all elements of the combo box?
Click to view Answer

Q7. How to select 2 or 3 elements of the combo box?
Click to view Answer

Q8. Select any link through java scripts
Click to view Answer

Q9. How to get Y axis of elements?
Click to view Answer

Q10. How to work with security certificate in selenium?
Click to view Answer

Q11. How to switch windows in selenium?
Click to view Answer

Q12. What are different annotations in TestNG?
Click to view Answer

Q13. Is WebDriver is interface or class?
Click to view Answer

Q14. What is Context Menu operation and how it is performed?
Click to view Answer

Monday, March 13, 2017

[Demo] Selenium 3 using Java on Ubuntu Linux

Selenium 3 doesn't launch Firefox just by creating instance of firefoxDriver() to WebDriver object. Instead now there is a new Gecko driver for firefox like the Chrome driver.

What is Gecko Driver? Find out more here

Download geckodriver and chromedriver for Ubuntu and Linux.

Set system property to specify the the Geckodriver path

System.setProperty("webdriver.gecko.driver", "/lib/geckodriver");

Download the complete code from GitHub

Java questions for Selenium automation testing position

Saturday, January 28, 2017

[TIPS] Selenium Implicit Wait - Turn ON and OFF

While automating web application Selenium Webdriver Implicit wait is applied to all findElement and findElements keyword till the element is visible. But in some case we need to check if fields visibility immediately on performing some actions. So why to wait for default implicit wait of 15 or 30 seconds.

Here is the simple tip to override Implicit default wait time by Turning OFF the implicit wait while performing action and validating field visibility. Below Java code snippet will be helpful -

 public void turnOFFImplicitWait(Webdriver driver)  {  
   driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);  
 }  

After verifying the step turn ON default implicit wait as below -
 public void turnONImplicitWait(Webdriver driver)  {  
   driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);  
 }