Selenium Flashcards

1
Q
  1. What is Selenium and what is composed of?
A
  • Selenium is a suite of tools for automated web testing. It is composed of;
    *Selenium IDE(Integrated Development Environment); a Firefox plugin that works for recording and playing back.
  • Selenium RC(Remote Control) (1.0) ; is a test tool and is used to work on JS to automate the web application. (2004)
  • WebDriver (2.0); is a web automation framework and allows you to execute your tests in different browsers. (2011)
  • Selenium Grid; allows tests to run in parallel across multiple machines.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. What are the advantages of Selenium?
A
    • Selenium is open source and free to use without any licensing cost
    • It supports multiple languages like Java, Ruby, Python, C#…
    • It supports multi-browser testing
    • It has a good amount of resources and helping community
    • It supports many operating systems like Windows, Mac, Linux …
    • Interact with the web application
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. What are the disadvantages of Selenium?
A
  • Selenium supports only web-based applications, does not support windows-based application
  • No built-in reporting tool, it needs third party tools for report generation activity
  • Cannot work with graphics, captchas, barcodes, shapes
  • It does not support file upload facility.
  • Hard to master, requires developer level knowledge
  • Hard to write good locators
  • Hard to synchronize
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. What are the limitations of Selenium?
A
  • We cannot test desktop application
  • We cannot test web services
  • Ewe have to use external libraries and tools for performing tasks like testing framework (TestNG, JUnit), reading from
    external files (Apache POI for excel)
  • Automating Captcha is not possible using Selenium
  • It does not support file upload facility.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. What types of testing you automate with Selenium?
A
  • functional tests (positive/negative, UI)
  • smoke tests
  • regression tests
  • integration tests
  • end to end testing
  • data driven
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. What we don’t do with selenium?
A
  • Performance, load, stress testing, manual ad hoc testing, (These tests are done by experts trained in these tools)
  • Pure database testing (if we only test the DB itself),
  • Unit tests…, look and feel based testing (color, shapes, etc.),
  • static testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. What is in the Selenium tool set?
A
  • Selenium IDE à implemented as a Chrome and Firefox extension, and allows you to record, edit, and debug tests.
  • Selenium RC à to write automated web application UI tests in any programming language
  • Selenium WebDriverà execute your tests against different browsers
  • Selenium GRID à run your tests on different machines against different browsers in parallel.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. What version of Selenium do you use right now?
A
  • JDK (JAVA) - 1.8 à I like it because of à Lambda exp. and, Try catch error handling you may add multiple catches.
  • IntelliJ - 2018.03.04
  • Selenium - 3.141.59
  • TestNG - 6.14.3
  • Cucumber – 4.2.6
  • Maven - 3.6.0
  • GIT - 2.17.2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. Implicit Wait vs Explicit Wait?
A
  • Implicit wait is a wait which waits for a specified time while locating an element before throwing
    “NoSuchElementException”. As by default selenium tries to find elements immediately without any wait. So, it is good
    to use implicit wait. This wait applied to all elements of the current driver instance.
  • Explicit wait is a wait which is applied to a particular webelement until the ExpectedCondition specified is met.
  • Implicit wait is simply; if condition is met before the timeout, it will continue to next step, if condition is not met within
    timeout throw “No Such Element” exception.
  • Explicit wait sometimes we need to wait for a certain event/condition such as element is visible, clickable, enabled….
    driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);
    webDriverWait wait = new WebDriverWait (driver, 5);
    wait.until (ExpectedConditions.visibilityOf(element);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. What is fluentWait?
A
  • Let’s say you have an element which sometime appears in just 1 second and some time it takes minutes to appear. In that
    case it is better to use fluent wait, as this will try to find element again and again until it find it or until the final timer runs
    out. Example is AJAX or JQuery
  • Subtype of explicit wait but you can override the conditions
    Wait<WebDriver>wait=new
    FluentWait<Webdriver>(driver).withTimout(5,timeUnit.seconds).pollingEvery(100,timeunit.
    milliseconds).ignoring(NoSuchElementException.class);</Webdriver></WebDriver>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. What are various ways of locating an element in Selenium?
A
  • Selenium Locators à Id & name
  • In selenium locator is a means of finding an element in the html :
  • Id, name, className, xpath, css, linkText, partialLinkText, tagName
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. Why I cannot find element?
A
  • Locator changed
  • There is an iframe
  • Waiting time:: page is loading slowly or Element is dynamic:: locator
  • Page is not fully loaded/opened
  • Page changes and that element does not exist anymore
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. How to highlight an element?
A
  • Selenium WebDriver doesn’t have highlight action.
  • But we can use JavaScript to do it
    JavascriptExecutor js = ((JavascriptExecutor) driver);
    String bgcolor = element.getCssValue(“backgroundColor”);
    for(inti=0;i< 10;i++){
    changeColor(“rgb(0,200,0)”,
    element,driver);//1
    changeColor(bgcolor,
    element,driver);//2
    }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. What is Xpath?
A
  • Xpath is used to find the location of any element on a webpage using html structure.
  • We could navigate through elements and attributes in an XML document to locate web Elements such as textbox.
  • button. checkbox, Image ext… in web Page
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. Absolute (/) and Relative (//) Xpath?
A
  • Syntax à //tagname[@attribute=value]
  • Absolute xpath starts with single slash ( / ), starting from root element and all the way to the element.
  • Relative xpath starts with double slash ( // ), starting selection matching anywhere in the document.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. How do you handle dynamic elements?
A
  • Find the static part of the id and write a locator(xpath or css) à And then use Startswith, contains, EndsWith
  • contains( ) à //*[contains(@name=btn)]
  • startwith( ) à //label[startwith(@id, message)]
  • text( ) à //td[text() = usedId]
  • or & and à //input[@type = submit AND @name = login]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
  1. How to test dynamic web page?
A
  • There is no one size fits all solution to this problem. We have to understand the application very well
  • o Use explicit waits where necessary.
  • o Use custom xpaths and css locators
  • § Xpath: contains, starts with, ends with, contains text.
  • § By finding the element in relation to another stable element using parent, child, sibling relationships
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q
  1. How to test dynamic table?
A
    • Use custom xpaths and css locators
  • o Xpath: contains, starts with, ends with, contains text.
  • o By finding the element in relation to another stable element using parent, child, sibling relationships
    • I have utility methods that work with table. I have method that takes a table webelement and returns all the column
  • names. I have a method that takes a table, number and returns all the data in that row.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q
  1. How can we move to parent element using xpath?
A
  • Using (..) expression in xpath, we can move to parent element
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q
  1. Difference between close() and quit() command?
A
  • driver.close() à used to close the current browser
  • driver.quit() à used to close all the browser instances
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q
  1. How can we move to nth child element using xpath?
A
    • There are two ways:
  • o using square brackets with index position
  • For ex: div[2] will find th* There are two ways:
  • o using square brackets with index position
  • For ex: div[2] will find the second div element
  • o using position ( ) method
  • For ex: div[position()=2] will find the second div elemente second div element
  • o using position ( ) method
  • For ex: div[position()=2] will find the second div element
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q
  1. Difference between xpath and css selector?
A
  • with xpath, we can search elements backward or forward…
    while css works only in forward direction
  • Xpath can work with text, css cannot work
  • Xpath has more combination and can search by index
    css cannot search by index, but css is working faster than xpath.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
  1. What is framework?
A
  • In test automation, framework is the blueprint of test automation.
  • It includes your folder structures, where to save you function library, test results, test data, resources.
  • It is essential because when you are working on a automation project everyone will have a guideline to follow and our
    script will be easier to maintain.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q
  1. Talking about HTML reporting during the interview?
A
    • I use multiple methods of reporting in my framework, driver script writes pass/fail to the test cases excel sheet,
    • Reporter utility object writes to UFT report, also I have developed a custom HTML reporting engine.
    • It sends HTML code to the Notepad and creates a nice HTML report document that nontechnical people can easily
  • understand and use.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q
  1. How to maximize a web page?
A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q
  1. In some cases, maximize() will not work > so what will be the way around?
A
  • Actions or change version.
    ChromeOptions options = new ChromeOptions();
    options.addArguments(“startmaximized”);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q
  1. What is the key class in Selenium?
A
  • Gives us option for pressing keys from keyboard
  • Key.ENTER
  • MUST BE PASSED TO SendKeys() method
  • Ex; .sendkeys(“charger” + keys.ENTER)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q
  1. What if there is a dynamic popup that comes up randomly
A
  • Use try/catch with alert
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q
  1. What is Thread.sleep()?
A
  • Slows down selenium to catch up
  • Throws exception so must handle it or throw it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q
  1. What is Selenium Framework?
A
  • It is a code structure that helps to make code maintenance easy, code readability and code reuse.
  • There are mainly 3 type of frameworks created by Selenium WebDriver to automate test cases:

Data Driven Framework
* It is one of the most popular automation frameworks in the market
* All of our test data is generated from some external files;
o excel
o or scenario outline in feature file
o or TestNG Data Provider
* Selenium WebDriver is a great tool to automate web-based applications. But it does not support read and write
operations on excel files. Therefore, we use third party APIs like Apache POI

Keyword Driven Framework
* Keyword driven testing is a scripting technique that uses data files to contain the keywords related to the application
being tested.
* Keywords are written in some external files like excel file and Java code will call this file and execute test cases.
HybridDriven Framework
* A combination of the DDF and KDF is commonly said to be HDF.
* Both the test data and test action are kept in external files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q
  1. How did you use overloaded Methods in Selenium?
A
  • When asserting if two values are equal, I use à Assert.assertEquals(actual, Expected) from TestNG
  • You can put in the parameters String, Objects, int, boolean values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q
  1. Why we get NoSuchElementException?
A
  • Check if locator is correct
  • Check if timing is correct
  • Check if element is hidden inside an iframe
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q
  1. How you handle js alerts?
A
  • If the alert on the browser comes from JavaScript, we use the Alert class.
    Alert alert = driver.switchTo.alert();
    alert.accept();
    alert.dismiss();
    alert.sendKeys();
    alert.getText()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q
  1. How to handle multiple frames?
A
  • If there are 4 frames, you have to go through each from consecutively to reach certain frame. Can’t jump to the 3rd frame
    from 1st frame.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q
  1. What is the difference between driver.get() and driver.navigateto() ?
A
  • driver.get() -> To open an URL and it will wait till the whole page gets loaded
  • driver.navigateto() -> To navigate to an URL and it will not wait till the whole page get loaded
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q
  1. How to handle frames in Selenium?
A
    • Frames used to embed a html page into another
    • Steps
  • o Locate the iframe
  • o Switch to another iframe with driver.switchTo().frame();
  • .frame() -> takes string, Integer, webElement, name or id directly as parameter
  • driver.switchTo().frame(webElement);
  • driver.switchTo().frame();
    • Now you are in the 2nd frame, if you want to find an element outside of the 2nd frame (that you’re currently on)
  • throws NosuchElementException
    • If you need to switch back to previous frame
  • o driver.switchTo().parentFrame() -> Goes one level up
  • o driver.switchTo().defaultcontent() -> Goes to the very top
    • Can switch using count
  • o driver.switchTo(0) -> Counts anything that is not the default frame
  • These methods might give you different results based on what browser you are using
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q
  1. How you handle browser pop ups?
A
  • void dismiss() -> clicks on the “Cancel” button as soon as the pop-up window appears.
  • void accept() ->clicks on the “Ok” button as soon as the pop-up window appears.
  • String getText() -> returns the text displayed on the alert box.
  • void sendKeys(String stringToSend)-> enters the specified string pattern into the alert box.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q
  1. How you handle windows/ OS pop ups?
A
  • Selenium doesn’t support windows-based apps, it is an automation testing tool that supports only web application testing.
  • We could handle windows-based popups in Selenium using some third-party tools such as AutoIT, Robot class
  • driver.getWindowHandle(); This will handle the current window that uniquely identifies it within this driver instance.
  • driver.getWindowHandles(); To handle all opened windows
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q
  1. How to handle Headless browser
A
  • Headless browser: browser that does not open, it runs as a background service / program.
  • Example is htmlunitdriver from selenium
    o WebDriver = new htmlunitdriver()
    o Not very stable
  • Phantonjsbrowser
    o More stable
    o browser = new phantomjsbrowser()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q
  1. findElement vs findElements?
A

*!FindElement > this method returns first WebElement !
* gives Exception if the element not found
*! FindElements > returns List <WebElement>;
* does not give Exception if the element not found as a result list has null values</WebElement>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q
  1. How to handle multiple windows/tabs?
A
  • Selenium stays on one window
  • If you open a window and then 5 tabs popped open, selenium is focused on the first window
  • If you are on a new window and you tell selenium to print an element on the default window, it will still work even that user’s focus is on the new window
  • Must switch to new window
  • Use windowHandle()
  • Driver.getWindowHandle()
  • Everytime Selenium opens a browser, it’s going to give an index ID for the page called Handles
  • Returns the handle/id of current page (as a string)
  • driver.switchTo().window(string handle)
  • Returns a Set of window handles
  • Switch using titles
    for(string handle: driver.getWindowHandles()){
    driver.switchTo().Window(handle)
    if(driver.getTitle().equals(targetTitle){
    break;
    }
    }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q
  1. How to find all links in the page?
A

List<WebElement> list = driver.findElements(By.tagName(“a”));</WebElement>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q
  1. Difference between isDisplayed(), isEnabled(). And is Selected() method in selenium WebDriver?
A
  • isDispalyed() -> verify the presence of a web element within the web page. If found à true, If not found à false
  • isDisplayed() -> check for the presence of all kinds of web elements available
  • isEnabled() ->verify if the web element is enabled or disabled within the web page.
  • isEnabled() -> is primarily used with buttons
  • isSelected() -> verifies if the web element is selected or not
  • isSelected() -> used with radio buttons, dropdowns and checkboxes.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q
  1. How to Drag And Drop ?
A

Actions action = new Actions(driver);
action.clickAndHold(driver.findElement(By.id(“item”)))
.moveToElement(driver.findElement(By.id(“destination”)))
.release().build()
.perform();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q
  1. For Scroll down:
A

WebDriver driver = new ChromeDriver(); JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript(“window.scrollBy(0,250)”, “”);
* OR, we can do as follows:
jse.executeScript(“scroll(0, 250);”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q
  1. For Scroll up:
A

jse.executeScript(“window.scrollBy(0,-250)”, “”); OR, jse.executeScript(“scroll(0,-250);”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q
  1. How to handle cookies?
A

● In Selenium Webdriver, we can query and interact with cookies with below built-in method:
driver.manage().getCookies(); // Return The List of all Cookies
driver.manage().getCookieNamed(arg0); //Return specific cookie according to name
driver.manage().addCookie(arg0); //Create and add the cookie
driver.manage().deleteCookie(arg0); // Delete specific cookie
driver.manage().deleteCookieNamed(arg0); // Delete specific cookie according Name
driver.manage().deleteAllCookies(); // Delete all cookies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q
  1. Why do we need to handle cookies?
A

● Each cookie is associated with a name, value, domain, path, expiry, and the status of whether it is secure or not. In order
to validate a client, a server parses all of these values in a cookie.
● When Testing a web application using selenium web driver, we may need to create, update or delete a cookie.
● For example, when automating Online Shopping Application, we many need to automate test scenarios like place order,
View Cart, Payment Information, order confirmation, etc.
● If cookies are not stored, we will need to perform login action every time before we execute above listed test scenarios.
This will increase your coding effort and execution time.
● The solution is to store cookies in a File. Later, retrieve the values of cookie from this file and add to it your current browser
session. As a result, you can skip the login steps in every Test Case because your driver session has this information in it.
● The application server now treats your browser session as authenticated and directly takes you to your requested URL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q
  1. Store cookies cookie information
A

public class cookieRead extends BasePage{
public static void main(String[] args){
driver.get(“http://demo.guru99.com/test/cookie/selenium_aut.php”);
// Input Email id and Password If you are already Register
driver.findElement(By.name(“username”)).sendKeys(“abc123”);
driver.findElement(By.name(“password”)).sendKeys(“123xyz”);
driver.findElement(By.name(“submit”)).click();
File file = new File(“Cookies.data”); // create file to store cookies
try {
file.delete(); // Delete old file if exists
file.createNewFile();
FileWriter fileWrite = new FileWriter(file);
BufferedWriter Bwrite = new BufferedWriter(fileWrite);
// loop for getting the cookie information
for(Cookie ck : driver.manage().getCookies()){
Bwrite.write((ck.getName() +”;”+ ck.getValue() +”;”+ ck.getDomain() +”;”+ ck.getPath()
+ “;” + ck.getExpiry() +”;”+ ck.isSecure()));
Bwrite.newLine();
}
Bwrite.flush(); Bwrite.close(); fileWrite.close();
} catch(Exception ex) {
ex.printStackTrace();
}
}
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q
  1. Do you use JavaScriptExecutor?
A
  • This helps me write my own JavaScript. JS has way more control than selenium.
  • we can send JS commands to the browser with using this class
    JavaScriptExecutor jsExecutor=(JavaScriptExecutor)driver;
    o executeScript(); performs the command
    o Inside the parameter is where you put JS code
  • jsExecutor.executeScript(“alert(‘WARNING: This is a useless message’);” à This code will bring up a JS popup
  • You can also put 2 parameters is .executeScript(“js code”,element);
    o Used for scrolling (selenium is not good with scrolling, you can say a challenge is when I was working on terms
    and condition page, where you have to read the page before clicking on continue.
    o When I tried using selenium and actions class it didn’t work, so i used javaexecutor ) and clicking an element;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q
  • Selenium is a suite of tools for automated web testing. It is composed of;
    *Selenium IDE(Integrated Development Environment); a Firefox plugin that works for recording and playing back.
  • Selenium RC(Remote Control) (1.0) ; is a test tool and is used to work on JS to automate the web application. (2004)
  • WebDriver (2.0); is a web automation framework and allows you to execute your tests in different browsers. (2011)
  • Selenium Grid; allows tests to run in parallel across multiple machines.
A
  1. What is Selenium and what is composed of?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q
    • Selenium is open source and free to use without any licensing cost
    • It supports multiple languages like Java, Ruby, Python, C#…
    • It supports multi-browser testing
    • It has a good amount of resources and helping community
    • It supports many operating systems like Windows, Mac, Linux …
    • Interact with the web application
A
  1. What are the advantages of Selenium?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q
  • Selenium supports only web-based applications, does not support windows-based application
  • No built-in reporting tool, it needs third party tools for report generation activity
  • Cannot work with graphics, captchas, barcodes, shapes
  • It does not support file upload facility.
  • Hard to master, requires developer level knowledge
  • Hard to write good locators
  • Hard to synchronize
A
  1. What are the disadvantages of Selenium?
54
Q
  • We cannot test desktop application
  • We cannot test web services
  • Ewe have to use external libraries and tools for performing tasks like testing framework (TestNG, JUnit), reading from
    external files (Apache POI for excel)
  • Automating Captcha is not possible using Selenium
  • It does not support file upload facility.
A
  1. What are the limitations of Selenium?
55
Q
  • functional tests (positive/negative, UI)
  • smoke tests
  • regression tests
  • integration tests
  • end to end testing
  • data driven
A
  1. What types of testing you automate with Selenium?
56
Q
  • Performance, load, stress testing, manual ad hoc testing, (These tests are done by experts trained in these tools)
  • Pure database testing (if we only test the DB itself),
  • Unit tests…, look and feel based testing (color, shapes, etc.),
  • static testing
A
  1. What we don’t do with selenium?
57
Q
  • Selenium IDE à implemented as a Chrome and Firefox extension, and allows you to record, edit, and debug tests.
  • Selenium RC à to write automated web application UI tests in any programming language
  • Selenium WebDriverà execute your tests against different browsers
  • Selenium GRID à run your tests on different machines against different browsers in parallel.
A
  1. What is in the Selenium tool set?
58
Q
  • JDK (JAVA) - 1.8 à I like it because of à Lambda exp. and, Try catch error handling you may add multiple catches.
  • IntelliJ - 2018.03.04
  • Selenium - 3.141.59
  • TestNG - 6.14.3
  • Cucumber – 4.2.6
  • Maven - 3.6.0
  • GIT - 2.17.2
A
  1. What version of Selenium do you use right now?
59
Q
  • Implicit wait is a wait which waits for a specified time while locating an element before throwing
    “NoSuchElementException”. As by default selenium tries to find elements immediately without any wait. So, it is good
    to use implicit wait. This wait applied to all elements of the current driver instance.
  • Explicit wait is a wait which is applied to a particular webelement until the ExpectedCondition specified is met.
  • Implicit wait is simply; if condition is met before the timeout, it will continue to next step, if condition is not met within
    timeout throw “No Such Element” exception.
  • Explicit wait sometimes we need to wait for a certain event/condition such as element is visible, clickable, enabled….
    driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);
    webDriverWait wait = new WebDriverWait (driver, 5);
    wait.until (ExpectedConditions.visibilityOf(element);
A
  1. Implicit Wait vs Explicit Wait?
60
Q
  • Let’s say you have an element which sometime appears in just 1 second and some time it takes minutes to appear. In that
    case it is better to use fluent wait, as this will try to find element again and again until it find it or until the final timer runs
    out. Example is AJAX or JQuery
  • Subtype of explicit wait but you can override the conditions
    Wait<WebDriver>wait=new
    FluentWait<Webdriver>(driver).withTimout(5,timeUnit.seconds).pollingEvery(100,timeunit.
    milliseconds).ignoring(NoSuchElementException.class);</Webdriver></WebDriver>
A
  1. What is fluentWait?
61
Q
  • Selenium Locators à Id & name
  • In selenium locator is a means of finding an element in the html :
  • Id, name, className, xpath, css, linkText, partialLinkText, tagName
A
  1. What are various ways of locating an element in Selenium?
62
Q
  • Locator changed
  • There is an iframe
  • Waiting time:: page is loading slowly or Element is dynamic:: locator
  • Page is not fully loaded/opened
  • Page changes and that element does not exist anymore
A
  1. Why I cannot find element?
63
Q
  • Selenium WebDriver doesn’t have highlight action.
  • But we can use JavaScript to do it
    JavascriptExecutor js = ((JavascriptExecutor) driver);
    String bgcolor = element.getCssValue(“backgroundColor”);
    for(inti=0;i< 10;i++){
    changeColor(“rgb(0,200,0)”,
    element,driver);//1
    changeColor(bgcolor,
    element,driver);//2
    }
A
  1. How to highlight an element?
64
Q
  • Xpath is used to find the location of any element on a webpage using html structure.
  • We could navigate through elements and attributes in an XML document to locate web Elements such as textbox.
  • button. checkbox, Image ext… in web Page
A
  1. What is Xpath?
65
Q
  • Syntax à //tagname[@attribute=value]
  • Absolute xpath starts with single slash ( / ), starting from root element and all the way to the element.
  • Relative xpath starts with double slash ( // ), starting selection matching anywhere in the document.
A
  1. Absolute (/) and Relative (//) Xpath?
66
Q
  • Find the static part of the id and write a locator(xpath or css) à And then use Startswith, contains, EndsWith
  • contains( ) à //*[contains(@name=btn)]
  • startwith( ) à //label[startwith(@id, message)]
  • text( ) à //td[text() = usedId]
  • or & and à //input[@type = submit AND @name = login]
A
  1. How do you handle dynamic elements?
67
Q
  • There is no one size fits all solution to this problem. We have to understand the application very well
  • o Use explicit waits where necessary.
  • o Use custom xpaths and css locators
  • § Xpath: contains, starts with, ends with, contains text.
  • § By finding the element in relation to another stable element using parent, child, sibling relationships
A
  1. How to test dynamic web page?
68
Q
    • Use custom xpaths and css locators
  • o Xpath: contains, starts with, ends with, contains text.
  • o By finding the element in relation to another stable element using parent, child, sibling relationships
    • I have utility methods that work with table. I have method that takes a table webelement and returns all the column
  • names. I have a method that takes a table, number and returns all the data in that row.
A
  1. How to test dynamic table?
69
Q
  • Using (..) expression in xpath, we can move to parent element
A
  1. How can we move to parent element using xpath?
70
Q
  • driver.close() à used to close the current browser
  • driver.quit() à used to close all the browser instances
A
  1. Difference between close() and quit() command?
71
Q
    • There are two ways:
  • o using square brackets with index position
  • For ex: div[2] will find th* There are two ways:
  • o using square brackets with index position
  • For ex: div[2] will find the second div element
  • o using position ( ) method
  • For ex: div[position()=2] will find the second div elemente second div element
  • o using position ( ) method
  • For ex: div[position()=2] will find the second div element
A
  1. How can we move to nth child element using xpath?
72
Q
  • with xpath, we can search elements backward or forward…
    while css works only in forward direction
  • Xpath can work with text, css cannot work
  • Xpath has more combination and can search by index
    css cannot search by index, but css is working faster than xpath.
A
  1. Difference between xpath and css selector?
73
Q
  • In test automation, framework is the blueprint of test automation.
  • It includes your folder structures, where to save you function library, test results, test data, resources.
  • It is essential because when you are working on a automation project everyone will have a guideline to follow and our
    script will be easier to maintain.
A
  1. What is framework?
74
Q
    • I use multiple methods of reporting in my framework, driver script writes pass/fail to the test cases excel sheet,
    • Reporter utility object writes to UFT report, also I have developed a custom HTML reporting engine.
    • It sends HTML code to the Notepad and creates a nice HTML report document that nontechnical people can easily
  • understand and use.
A
  1. Talking about HTML reporting during the interview?
75
Q

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

A
  1. How to maximize a web page?
76
Q
  • Actions or change version.
    ChromeOptions options = new ChromeOptions();
    options.addArguments(“startmaximized”);
A
  1. In some cases, maximize() will not work > so what will be the way around?
77
Q
  • Gives us option for pressing keys from keyboard
  • Key.ENTER
  • MUST BE PASSED TO SendKeys() method
  • Ex; .sendkeys(“charger” + keys.ENTER)
A
  1. What is the key class in Selenium?
78
Q
  • Use try/catch with alert
A
  1. What if there is a dynamic popup that comes up randomly
79
Q
  • Slows down selenium to catch up
  • Throws exception so must handle it or throw it
A
  1. What is Thread.sleep()?
80
Q
  • It is a code structure that helps to make code maintenance easy, code readability and code reuse.
  • There are mainly 3 type of frameworks created by Selenium WebDriver to automate test cases:

Data Driven Framework
* It is one of the most popular automation frameworks in the market
* All of our test data is generated from some external files;
o excel
o or scenario outline in feature file
o or TestNG Data Provider
* Selenium WebDriver is a great tool to automate web-based applications. But it does not support read and write
operations on excel files. Therefore, we use third party APIs like Apache POI

Keyword Driven Framework
* Keyword driven testing is a scripting technique that uses data files to contain the keywords related to the application
being tested.
* Keywords are written in some external files like excel file and Java code will call this file and execute test cases.
HybridDriven Framework
* A combination of the DDF and KDF is commonly said to be HDF.
* Both the test data and test action are kept in external files.

A
  1. What is Selenium Framework?
81
Q
  • When asserting if two values are equal, I use à Assert.assertEquals(actual, Expected) from TestNG
  • You can put in the parameters String, Objects, int, boolean values
A
  1. How did you use overloaded Methods in Selenium?
82
Q
  • Check if locator is correct
  • Check if timing is correct
  • Check if element is hidden inside an iframe
A
  1. Why we get NoSuchElementException?
83
Q
  • If the alert on the browser comes from JavaScript, we use the Alert class.
    Alert alert = driver.switchTo.alert();
    alert.accept();
    alert.dismiss();
    alert.sendKeys();
    alert.getText()
A
  1. How you handle js alerts?
84
Q
  • If there are 4 frames, you have to go through each from consecutively to reach certain frame. Can’t jump to the 3rd frame
    from 1st frame.
A
  1. How to handle multiple frames?
85
Q
  • driver.get() -> To open an URL and it will wait till the whole page gets loaded
  • driver.navigateto() -> To navigate to an URL and it will not wait till the whole page get loaded
A
  1. What is the difference between driver.get() and driver.navigateto() ?
86
Q
    • Frames used to embed a html page into another
    • Steps
  • o Locate the iframe
  • o Switch to another iframe with driver.switchTo().frame();
  • .frame() -> takes string, Integer, webElement, name or id directly as parameter
  • driver.switchTo().frame(webElement);
  • driver.switchTo().frame();
    • Now you are in the 2nd frame, if you want to find an element outside of the 2nd frame (that you’re currently on)
  • throws NosuchElementException
    • If you need to switch back to previous frame
  • o driver.switchTo().parentFrame() -> Goes one level up
  • o driver.switchTo().defaultcontent() -> Goes to the very top
    • Can switch using count
  • o driver.switchTo(0) -> Counts anything that is not the default frame
  • These methods might give you different results based on what browser you are using
A
  1. How to handle frames in Selenium?
87
Q
  • void dismiss() -> clicks on the “Cancel” button as soon as the pop-up window appears.
  • void accept() ->clicks on the “Ok” button as soon as the pop-up window appears.
  • String getText() -> returns the text displayed on the alert box.
  • void sendKeys(String stringToSend)-> enters the specified string pattern into the alert box.
A
  1. How you handle browser pop ups?
88
Q
  • Selenium doesn’t support windows-based apps, it is an automation testing tool that supports only web application testing.
  • We could handle windows-based popups in Selenium using some third-party tools such as AutoIT, Robot class
  • driver.getWindowHandle(); This will handle the current window that uniquely identifies it within this driver instance.
  • driver.getWindowHandles(); To handle all opened windows
A
  1. How you handle windows/ OS pop ups?
89
Q
  • Headless browser: browser that does not open, it runs as a background service / program.
  • Example is htmlunitdriver from selenium
    o WebDriver = new htmlunitdriver()
    o Not very stable
  • Phantonjsbrowser
    o More stable
    o browser = new phantomjsbrowser()
A
  1. How to handle Headless browser
90
Q

*!FindElement > this method returns first WebElement !
* gives Exception if the element not found
*! FindElements > returns List <WebElement>;
* does not give Exception if the element not found as a result list has null values</WebElement>

A
  1. findElement vs findElements?
91
Q
  • Selenium stays on one window
  • If you open a window and then 5 tabs popped open, selenium is focused on the first window
  • If you are on a new window and you tell selenium to print an element on the default window, it will still work even that user’s focus is on the new window
  • Must switch to new window
  • Use windowHandle()
  • Driver.getWindowHandle()
  • Everytime Selenium opens a browser, it’s going to give an index ID for the page called Handles
  • Returns the handle/id of current page (as a string)
  • driver.switchTo().window(string handle)
  • Returns a Set of window handles
  • Switch using titles
    for(string handle: driver.getWindowHandles()){
    driver.switchTo().Window(handle)
    if(driver.getTitle().equals(targetTitle){
    break;
    }
    }
A
  1. How to handle multiple windows/tabs?
92
Q

List<WebElement> list = driver.findElements(By.tagName(“a”));</WebElement>

A
  1. How to find all links in the page?
93
Q
  • isDispalyed() -> verify the presence of a web element within the web page. If found à true, If not found à false
  • isDisplayed() -> check for the presence of all kinds of web elements available
  • isEnabled() ->verify if the web element is enabled or disabled within the web page.
  • isEnabled() -> is primarily used with buttons
  • isSelected() -> verifies if the web element is selected or not
  • isSelected() -> used with radio buttons, dropdowns and checkboxes.
A
  1. Difference between isDisplayed(), isEnabled(). And is Selected() method in selenium WebDriver?
94
Q

Actions action = new Actions(driver);
action.clickAndHold(driver.findElement(By.id(“item”)))
.moveToElement(driver.findElement(By.id(“destination”)))
.release().build()
.perform();

A
  1. How to Drag And Drop ?
95
Q

WebDriver driver = new ChromeDriver(); JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript(“window.scrollBy(0,250)”, “”);
* OR, we can do as follows:
jse.executeScript(“scroll(0, 250);”);

A
  1. For Scroll down:
96
Q

jse.executeScript(“window.scrollBy(0,-250)”, “”); OR, jse.executeScript(“scroll(0,-250);”);

A
  1. For Scroll up:
97
Q

● In Selenium Webdriver, we can query and interact with cookies with below built-in method:
driver.manage().getCookies(); // Return The List of all Cookies
driver.manage().getCookieNamed(arg0); //Return specific cookie according to name
driver.manage().addCookie(arg0); //Create and add the cookie
driver.manage().deleteCookie(arg0); // Delete specific cookie
driver.manage().deleteCookieNamed(arg0); // Delete specific cookie according Name
driver.manage().deleteAllCookies(); // Delete all cookies

A
  1. How to handle cookies?
98
Q

● Each cookie is associated with a name, value, domain, path, expiry, and the status of whether it is secure or not. In order
to validate a client, a server parses all of these values in a cookie.
● When Testing a web application using selenium web driver, we may need to create, update or delete a cookie.
● For example, when automating Online Shopping Application, we many need to automate test scenarios like place order,
View Cart, Payment Information, order confirmation, etc.
● If cookies are not stored, we will need to perform login action every time before we execute above listed test scenarios.
This will increase your coding effort and execution time.
● The solution is to store cookies in a File. Later, retrieve the values of cookie from this file and add to it your current browser
session. As a result, you can skip the login steps in every Test Case because your driver session has this information in it.
● The application server now treats your browser session as authenticated and directly takes you to your requested URL.

A
  1. Why do we need to handle cookies?
99
Q

public class cookieRead extends BasePage{
public static void main(String[] args){
driver.get(“http://demo.guru99.com/test/cookie/selenium_aut.php”);
// Input Email id and Password If you are already Register
driver.findElement(By.name(“username”)).sendKeys(“abc123”);
driver.findElement(By.name(“password”)).sendKeys(“123xyz”);
driver.findElement(By.name(“submit”)).click();
File file = new File(“Cookies.data”); // create file to store cookies
try {
file.delete(); // Delete old file if exists
file.createNewFile();
FileWriter fileWrite = new FileWriter(file);
BufferedWriter Bwrite = new BufferedWriter(fileWrite);
// loop for getting the cookie information
for(Cookie ck : driver.manage().getCookies()){
Bwrite.write((ck.getName() +”;”+ ck.getValue() +”;”+ ck.getDomain() +”;”+ ck.getPath()
+ “;” + ck.getExpiry() +”;”+ ck.isSecure()));
Bwrite.newLine();
}
Bwrite.flush(); Bwrite.close(); fileWrite.close();
} catch(Exception ex) {
ex.printStackTrace();
}
}
}

A
  1. Store cookies cookie information
100
Q
  • This helps me write my own JavaScript. JS has way more control than selenium.
  • we can send JS commands to the browser with using this class
    JavaScriptExecutor jsExecutor=(JavaScriptExecutor)driver;
    o executeScript(); performs the command
    o Inside the parameter is where you put JS code
  • jsExecutor.executeScript(“alert(‘WARNING: This is a useless message’);” à This code will bring up a JS popup
  • You can also put 2 parameters is .executeScript(“js code”,element);
    o Used for scrolling (selenium is not good with scrolling, you can say a challenge is when I was working on terms
    and condition page, where you have to read the page before clicking on continue.
    o When I tried using selenium and actions class it didn’t work, so i used javaexecutor ) and clicking an element;
A
  1. Do you use JavaScriptExecutor?
101
Q

How to check if element is present/visible/enable/ and to check text present?

A

To check Element Present:
if(driver.findElements(By.xpath(“value”)).size() != 0){
System.out.println(“Element is Present”);
}else{
System.out.println(“Element is Absent”);}
* or
if(driver.findElement(By.xpath(“value”))!= null){
System.out.println(“Element is Present”);
}else{
System.out.println(“Element is Absent”); }
* To check Visible:
if(driver.findElement(By.cssSelector(“a > font”)).isDisplayed()){
System.out.println(“Element is Visible”);
}else{
System.out.println(“Element is InVisible”); }
* To check Enable:
if(driver.findElement(By.cssSelector(“a > font”)).isEnabled()){
System.out.println(“Element is Enable”);
}else{
System.out.println(“Element is Disabled”); }
* To check text present
if(driver.getPageSource().contains(“Text to check”)){
System.out.println(“Text is present”);
}else{
System.out.println(“Text is absent”); }

102
Q

How check the multiple selected values in dropdown?

A
  • Select carsList = new Select(el)
  • carList.getSelectedOptions(): //returns the the selected options a list ( List<webelement>)</webelement>
  • for each : carList.getSelectedOptions()
103
Q

How to use actions class?

A
  • Actions class lets us do advanced mouse and keyboard operations:
  • Control the mouse
  • Class that provides methods for advanced user interactions
    *Hovering
  • Scroll
  • Double click
  • Drag and drop
  • Right click
  • mix/match operators
  • Actions action=new Actions(driver)
  • Action methods
    *click()
    *perform()
    *hold()
  • keydown()build()
  • moveToElement(element)
  • dragAndDrop(source,target).perform()
  • sendKeys() different from the one we usually use
  • Let’s you do the sendkeys operation on different elements
  • Regular sendkeys that comes from webelement will throw an exception on something that is not input text.
  • The long way is;
    *actions.moveToElement(source).clickAndHold().moveToElement(target).release().perform();
  • Actions won’t work unless perform() is used
  • If you are chaining methods, you must use build() before perform()
104
Q

What is the syntax for double click action ?

A
  • To perform any actions against web element using actions class, we need to locate the element first:
    WebElement el = driver.findELement
    Actions actions = new Actions (driver).perform actions.doubleClick(el).perform()
    actions.moveTo(el).perform actions.doubleClick.perform
    actions.moveTo(el).doubleClick().build.perform()
105
Q

File download and upload

A
  • Download
    o Selenium itself cannot verify file downloads, can click on download link but can’t go outside the browser and open the
    downloaded file
    o Other tools need to be used for that Robot and AutoIT
  • Upload
    o Selenium handles the upload, but does it differently compared to actual user
    o Steps
  • Find the element that triggers the upload window
  • Find the path of the file you want to upload
    o Store into a String
  • Ex: String à file=”C:\Users\Andy\Desktop\folder1\file.key”;
  • Then driver.findElement(upload button).sendkeys(file);
106
Q

How check the selected value in dropdown?

A

Select carsList = new Select(el)
carList.getFirstSelectedOption()
assertequals(“some text”,carList.getFirstSelectedOption().getText() )

107
Q

How to work with dropdown without the select tag?

A
  • If the dropdown list has no select tag, we cannot use the select class
  • Treat the dropdown list and its options as separate elements, locate every element separately
  • To select an option:
    o 1. Find and click on the list
    o 2. Find and click on the option
108
Q

What if there’s no select tag?

A
  • You have to select the label for the dropdown separately as a webelement.
  • Then manually use click method
109
Q

Sometimes sendKeys does not work

A
  • Robot or AutoIT
  • library==jar file==dependency
110
Q

What is the syntax for switching frame ?

A
  • Frame is a html document inside another html document.
  • Web driver handles one page/html document at a time. To control another frame, we always need to switch
  • Driver.switchTo.frame(webelement) à find the iframe and pass as a param
  • Driver.switchTo.frame(string) à find the id or name of the iframe and pass as a param
  • Driver.switchTo.frame(int) à find the index and pass as a param
111
Q

What is the syntax for switching windows ?

A
  • To handle separate tabs/windows we have to switch to that tab
  • Web driver handles one page/html document at a time.
  • To control another tab, we always need to switch
  • To be able switch we need to get the window handle first using:
    getWindowHandles() method driver.switchTo.window(String) // -> window handle
    //for each loop : driverGetWIndowHandles:
    Driver.switchTo.window(“handle”)
    Ifdriver.getTitle==expectedtitle;
    Break;
112
Q

What is the syntax for uploading a file?

A

Public void fileUpload(Stirng path){
WebELement upload = driver.findELement; Upload.sendKeys(path)
}
* We need to locate the upload button in html.
* The element will have tag input.
* Then we do sendKeys by passing the path to file which we want to upload

113
Q

Sometimes sendKeys/path does not work

A
  • Building a dynamic path for a file inside our project Path to the project location:
    String projectDir= System.getProperty(“user.dir”) // project directory
    String file= “src/test/resources/test_data/myfile.txt”;
    Element.sendKeys(projectDir+file);
114
Q

How to input text in the text box without calling the sendKeys()?

A

//Use javascriptExecutor
JavascriptExecutor JS = (JavascriptExecutor)webdriver;
//To enter username
JS.executeScript(“document.getElementById(‘User’).value= ’www.google.com’”);
//To enter password
JS.executeScript(“document.getElementById(‘pass’).value=’ tester’”);

115
Q

How to press ENTER key on text box in Selenium WebDriver?

A
  • To press Enter key using Selenium WebDriver,
  • We need to use Selenium Enum keys with its constant Enter
  • Driver.findElement(By.xpath(“xpath”)).sendKeys(Keys.ENTER);
116
Q

Have you done any cross-browser testing? cross browser testing

A

Always mention that you have a control file for keywords like browser type, main url, username, password, environment.

117
Q

How you resolve certification issue?

A
  • CHROME, IE à DesiredCapabilities capability = DesiredCapabilities.chrome();
  • on Jenkins we need to insert -> .relaxedHTTPSValidation
    Response response=RestAssured.given()
    .contentType(ContentType.JSON)
    .relaxedHTTPSValidation()
    .get(“https://api.got.show/api/continents”);
    System.out.println(response.asString());
118
Q

How would you verify the position of the Web Element on the page?

A
  • element.getLocation();
  • WebElement class has a get Location method with returns the top left corner of the element
119
Q

Page Factory class?

A
  • Page Factory class comes with Selenium.
  • And it is used whenever we create page object classes.
  • Its purpose is to initialize webElements that were defined in the class.
120
Q

Explain me your test execution flow with cucumber.

A

Runner > Feature file > Scenario > Steps > Step def > Selenium code using POM

121
Q

What tools are you using to test UX and Restful webServices?

A
  • UX -> User Experience. First ensure UX is acceptable manually.
  • After that since it is UI testing, I use Selenium WebDriver to automate it.
  • RESTFul API Automation > RestAssured Library, PostMan for manual tests
122
Q

How To resize browser Window Using Selenium WebDriver?

A
  • To resize the browser window to particular dimensions, we use ‘Dimension’ class to resize the browser window.
  • //Create object of Dimensions class
    Dimension d = new Dimension(480,620);
  • //Resize the current window to the give n dimension
    driver.manage().window().setSize(d);
123
Q

What exceptions do you know in Selenium?

A
  • I often have NoSuchElementException
  • StaleElementException
    o The element has been deleted entirely.
    o The element is no longer attached to the DOM.
    o How we handle StaleElementException;
  • Element is not attached to DOM à ‘try catch block’ within ‘for loop’
    Or
    1. Refresh the page and try again for the same element.
    1. Wait for the element till it gets available
  • TimeOutException
124
Q

ASSERT(hard assert) VS VERIFY(soft assert)

A
  • Hard assert throws an AssertException immediately when an assert statement fails, and test suite continues with next
    @Test. If Assert steps fails, execution of test stops at that point! and will go to next test if present!
  • (Example: just simple Assert.assertTrue(boolean);)
  • Soft assert collects errors during @Test Soft Assert does not throw an exception when an assert fails and would continue
    with the next step after the assert statement. If Verify steps fails, it will report a fail but will continue execution!
  • Example: SoftAssert soft=new SoftAssert(); //for soft create object
    *soft.assertTrue(boolean);
  • soft.assertAll(); //put at the end it will report what is failing!
125
Q

What the verification point available in Selenium ?

A
  • In selenium IDE, We use Selenium Verify and Assert Commands as Verification points
  • In Selenium WebDriver, There is no built-in features for verification points, it totally depends on our coding style. Some of
    the Verification points are
  • to check for page title
  • to check for certain text
  • to check for certain element(text box, button, drop down, etc.)
126
Q

Verify text exists?

A
  • VerifyTextPresent -> returns TRUE if the specified text string was FOUND somewhere in the page; FALSE if otherwise.
  • VerifyTextNotPresent-> returns TRUE if the specified text string was NOT FOUND anywhere in the page; FALSE if it was
    found.
127
Q
  1. How do you find a text in a webpage?
A
  • //tagname[contains(text(),’text’)] contains certain test
  • //tagname[.=’text’] contains exact text sometimes doesn’t work Selenium
128
Q

How to get all the preceding siblings of Apple?

A
  • Xpath: “//ul/li[contains(text(),’Apple Mobiles’)]/precedingsibling::li”
  • This will give “Samsung Mobiles”
129
Q

How to handle Web Tables/grid?

A
  • Table tag used for table data is arranged in a grid format
    o th tag for column name Example –

<tr>
<th>FirstName</th> column names on the very top row
<th>Lastname</th>
<th>Age</th>
</tr>

o </tr> tr tag used to indicate a row, applies to whole column td tag to indicate a column in a row Example

<tr>
<td>Danny</td> actual_data_on_the_very_first_row
<td>Smith</td>
<td>29</td>
</tr>

  • Some tables have tbody Used to indicate the data of the table, usually does not include column names ( th )
130
Q

How to use Excel?

A

FileInputStream ExcelFile = new FileInputStream(path);
excelWBook = new XSSFWorkbook(ExcelFile);
excelWSheet = excelWBook.getSheet(sheetName);
cell = excelWSheet.getRow(rowNum).getCell(colNum);

131
Q

How do you like Selenium version 3? Is Selenium 3 drastically different from Selenium 2?

A
  • Selenium 3 has bug fixes from selenium 2 also it is more mobile automation focused.
  • We aim for Selenium 3 to be “a tool for user-focused automation of mobile and web apps”.
  • Here is the summary of the change.
    o For WebDriver users, it’s more of bug fixes and drop-in replacement for 2.
    o Selenium Grid bug fixes are done as well.
    o Selenium project will not actively support only the WebDriver API.
    o By a quirk of timing, Mozilla have made changes to Firefox that mean that from Firefox 48 you must use their
    geckodriver to use that browser, regardless of whether you’re using Selenium 2 or
    o As we know Selenium 3.0 is the latest version of Selenium Jar