"Karmanyevadhikaraste ma phaleshu kadachana, Ma karma phala hetur bhurmatey sangostva akarmani."

selenium interview qns

1. What is fluent wait in Web driver?
2. what are listeners in Web Driver, how we can use?
3. What is Hash Map and Hash Tables?
4.  What is ThreadSafe?
5. What is the Frame your using Junit or TestNg?
6. How to handle Ajax controls?
7. What are dependency Injections?
8. How to find out no. of rows in a WebTable.?
9.How to find out no.of columns in a Web Table?
10. Explain about your framework?
11. How to Class and Test in TestNg?
12. Inheritance,polymorphism,object, class, method, Abstractions, Encapsulations, Collections,?
13. can we call a private variable from one class to another class.?
14. How do you Start testing with Automation.?
15. What type of scenarios can be automated and what can't ?

Imp selenium qn's

 I want to run all the tests in sequence.




I added the preserve-order parameter in the suite. The tests run in the order we specified.


<suite name="Suite" preserve-order="true">
 
2. I want to run the tests in multiple browser ? show me with code and xml file.
 
Ans: 

Multi Browser Testing using Selenium TestNG

This Section describes how to run your Test cases on different browsers.

Few Simple steps Using TestNG :)

Step 1: Create your Script. Using TestNG annotations. Define parameters (using @Parameters) for taking input value i.e, which browser should be used for Running the Test

Step 2: Create a TestNG XML for running your script

Step 3: Configure the TestNG XML for passing parameters i.e, to tell which browser should be used for Running the Test

Step 4: Run the TestNG XML which can pass the appropriate browser name to the Script such that the Test Case is executed in a specified browser


Programatically this can be Done as follows:

Step 1:


package atu.multibrowser;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
public class MultiBrowserTest {
       private WebDriver driver;
       // Configure for multi browser drivers
       @Parameters("browser")
       @BeforeClass
       public void beforeTest(String browser) {
              if (browser.equalsIgnoreCase("firefox")) {
                     driver = new FirefoxDriver();
              } else if (browser.equalsIgnoreCase("chrome")) {
                     // Set Path for the executable file
                     System.setProperty("webdriver.chrome.driver",
                                  "D:\\chromedriver.exe");
                     driver = new ChromeDriver();
              } else if (browser.equalsIgnoreCase("ie")) {
                     // Set Path for the executable file
                     System.setProperty("webdriver.ie.driver""D:\\IEDriverServer.exe");
                     driver = new InternetExplorerDriver();
              } else {
                     throw new IllegalArgumentException("The Browser Type is Undefined");
              }
              // Open App
              driver.get("http://demo.opensourcecms.com/wordpress/wp-login.php");
       }
       @Test
       public void login() throws InterruptedException {
              // Enter UserName
              driver.findElement(By.id("user_login")).clear();
              driver.findElement(By.id("user_login")).sendKeys("admin");
              // Enter Password
              driver.findElement(By.id("user_pass")).clear();
              driver.findElement(By.id("user_pass")).sendKeys("demo123");
              // Click on Submit button
              driver.findElement(By.id("wp-submit")).submit();
       }
       @AfterClass
       public void afterTest() {
              try {
                     driver.quit();
              } catch (Exception e) {
                     driver = null;
              }
       }
}



Step 2 & Step 3: The below XML is configured to run the Test Case in Firefox, Chrome and IE browser in sequential manner

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="none">
       <test name="FirefoxTest">
              <parameter name="browser" value="firefox" />
              <classes>
                     <class name="atu.multibrowser.MultiBrowserTest" />
              </classes>
       </test>
       <test name="ChromeTest">
              <parameter name="browser" value="chrome" />
              <classes>
                     <class name="atu.multibrowser.MultiBrowserTest" />
              </classes>
       </test>
       <test name="IETest">
              <parameter name="browser" value="ie" />
              <classes>
                     <class name="atu.multibrowser.MultiBrowserTest" />
              </classes>
       </test>
</suite>


3. What is the Use of VERBOSE in TestNg,.

http://seleniumone-by-arun.blogspot.in/2013/05/158-understanding-usage-of-verbose.html

Release mgt

http://www.slideshare.net/gaoliang641/understand-release-engineering




Buildbot:
Buildbot is a job scheduling system: it queues jobs, executes the jobs when the required resources are available, and reports the results.
Your Buildbot installation has one or more masters and a collection of slaves. The masters monitor source-code repositories for changes, coordinate the activities of the slaves, and report results to users and developers. Slaves run on a variety of operating systems.