DELL – Selenium Interview Questions
Here is the list of Selenium Interview Questions which are recently asked in DELL company. These questions are included for both Freshers and Experienced professionals. Our Selenium Training has Answered all the below Questions.
1. Tell about yourself?
First of all, describe yourself and Summaries all your important academic and professional achievements in a subtle manner.
2. Which framework you are using?
Different types of framework available in testing. You can share which one you used with your project.
For example,
Here I have used data driven framework in my project. Because we can run our tests on multiple data in multiple combinations with the help of parameterization
3. Explain your framework architecture?
It a lot of process, you can explain each and every process of your framework architecture. You have to explain each component of your project and test plan, Test-Base class.
4. Webdriver is interface or class?
It is Interface. All the methods which are declared in Webdriver interface are implemented by respective driver class.
5. List some classes which implements webdriver?
Some important classes which implements webdriver is given below- AbstractAnnotations.
- AbstractDriverOptions.
- AbstractFindByBuilder.
- AbstractHttpCommandCodec.
- AbstractHttpCommandCodec.CommandSpec.
- AbstractHttpResponseCodec.
- AbstractWebDriverEventListener.
- AcceptedW3CCapabilityKeys.
6. List some methods in webdriver?
Following are the some important methods in webdriver- get() Syntax: get(url)
- getCurrentUrl() Syntax: getCurrentUrl()
- getTitle() Syntax: getTitle()
- findElements() Syntax: findElements(By by)
- findElement()
- getPageSource()
- close()
- ()
7. What is Webelement?
Everything that is present on the web page is a WebElement such as text box, button, etc. WebElement represents an HTML element.Types of webelements
- Edit box
- Link
- Button
- Image, image link, an image button
- Text area
- Checkbox
- Radio button
- Dropdown list
8. List some methods in webelements?
Top 10 methods in web elements:- clear
- click
- findElement
- findElements
- getAttribute
- getCssValue
- getLocation
- getRect
- getSize
- getTagName
- getText
9. What are the locators?
Locators are defined as an address that identifies a web element uniquely within the webpage. It is a command that tells Selenium IDE which GUI elements like – Text Box, Buttons, Check Boxes etc, it needs to operate on.
10. Which locator you prefer?
- By CSS ID: find_element_by_id
- By CSS class name: find_element_by_class_name
- By name attribute: find_element_by_name
- By DOM structure or xpath: find_element_by_xpath
- By link text: find_element_by_link_text
- By partial link text: find_element_by_partial_link_text
- By HTML tag name: find_element_by_tag_name
11. How to configure selenium web driver in eclipse?
It’s easy to get up and running with Selenium-WebDriver using Eclipse and the Java bindings on Windows.- Install Java
- Install Eclipse
- Download the Selenium Java Client Driver
- Configure Eclipse IDE with WebDriver.
12. What is an Object repository?
Object Repository is defined by a collection of object and properties with which QTP will be able to recognize the objects and act on it. While testing the records, the objects and properties are captured by default. Without understanding objects and its properties, QTP will NOT be able to play back the scripts.
13. What is difference between assert and verify commands?
Assert | Verify commands |
---|---|
It is Verifies if the specified condition is true and false. | Verifies if the specified condition is true and false. |
In case of false condition, the next text case of the suite will be executed. | In case of false condition, the next test step of the same text case will continue. |
14. What is a fundamental difference between XPath and css selector?
XPath | css selector |
---|---|
XPath stands for XML Path. It’s a query language that helps identify elements from an XML document. | Most HTML pages are styled using cascading style sheet classes, also known as CSS |
Creating in XPath is more flexible than in CSS Selector. | It’s much easier to learn and implement. |
XPath allows you to navigate up the DOM when looking for elements to test or scrape. | The CSS selectors identify the various elements in the DOM, and they affect or connect to these parts of the interface. |
15. What is a data-driven framework?
Data Driven framework is used to drive test cases and suites from an external data feed. The data feed can be data sheets like xls, xlsx, and csv files.
Developing Data Driven framework in Selenium using POI helps reduce maintenance, improve test coverage thus providing a good return on investment.
Free PDF : Get our updated Selenium Course Content pdf
16. If I dont have id or class name, which locator you use?
17. How to get the count of all links in a webpage?
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.concurrent.TimeUnit;
public class LinkCount {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\credo\\Desktop\\Java\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
String url = " https://www.credosystemz.com/";
driver.get(url);
driver.manage().timeouts().implicitlyWait(12, TimeUnit.SECONDS);
//Using tagname with anchor
List links = driver.findElements(By.tagName("a"));
System.out.println(“The number of links is “ + links.size());
driver.close();
}
18. How to click ok in alert popup?
1. Void dismiss():when the ‘Cancel’ button is clicked in the alert box.
2. Void accept():to click on the ‘OK’ button of the alert.
3. String getText():to capture the alert message.
4. Void sendKeys(String stringToSend): to send data to the alert box.
19. How to right click on particular link?
Driver.findElement(By.xpath("//a[text()='App Configuration']")).click();
20. How to get the count of windows opened? How to switch to 1st window and click on OK button?
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class childWindow {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver","./src/resources/chromedriver");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://demoqa.com/browser-windows");
// Open new window by clicking the button
driver.findElement(By.id("windowButton")).click();
// Click on the new window element and read the text displayed on the window
WebElement text = driver.findElement(By.id("sampleHeading"));
// Fetching the text using method and printing it
System.out.println("Element found using text: " + text.getText());
driver.quit();
}
}
21. How to take screenshot?
Convert web driver object to TakeScreenshot
Call getScreenshotAs method to create image file
Copy file to Desired Location
22. Having a string s=100, convert this to integer?
Below code for your reference,
class StrConvert{
public static void main(String []args){
String strTest = "100";
int iTest = Integer.parseInt(strTest);
System.out.println("Actual String:"+ strTest);
System.out.println("Converted to Int:" + iTest);
//This will now show some arithmetic operation
System.out.println("Arithmetic Operation on Int: " + (iTest/4));
}
}
23. Explain the methods in String Class?
public class Example{
public static void main(String args[]){
//creating a string by java string literal
String str = "Beginnersbook";
char arrch[]={'h','e','l','l','o'};
//converting char array arrch[] to string str2
String str2 = new String(arrch);
//creating another java string str3 by using new keyword
String str3 = new String("Java String Example");
//Displaying all the three strings
System.out.println(str);
System.out.println(str2);
System.out.println(str3);
}
}
24. Overloading vs Overriding?
Overloading | Overriding |
---|---|
Method overloading is performed within class. | Method overriding occurs in two classes that have IS-A (inheritance) relationship. |
In this, methods must have same name and different signature. | While in this, methods must have same name and same signature. |
Method overloading may or may not require inheritance. | While method overriding always needs inheritance. |
25. List vs Hashmap?
List | Hashmap |
---|---|
ArrayList is a part of collection framework and is present in java.util package | HashMap is a part of Java’s collection since Java 1.2 |
It provides us dynamic arrays in Java. | It provides the basic implementation of Map interface of Java |
Both ArrayList and HashMap can be traversed through Iterator in Java. | Both ArrayList and HashMap can be traversed through Iterator in Java. |
26. How to maximize window?
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Max {
public static void main(String args[]) throws InterruptedException
{
System.setProperty("");
WebDriver driver = new ChromeDriver();
// Navigate to a website
driver.get("https://www.browserstack.com/");
//Mazimize current window
driver.manage().window().maximize();
//Delay execution for 5 seconds to view the maximize operation
Thread.sleep(5000);
//Close the browser
driver.quit();
}
}
27. How to configure selenium web driver in eclipse?
WebDriverBackedSelenium is used for migrating Selenium 1.0(Selenium RC) to webDriver tests.
Below are the steps for migration.
Execute existing RC script with latest Selenium release to eliminate application/ script issues.
Create selenium instance from webDriver
28. What is webdriver backed selenium?
- Open source
- Easy to use
- Supports different OS
- Works with various browsers
- used for Android, iPhone, Blackberry etc. based application testing.
- very less CPU and RAM
29. Why should Selenium be selected as a test tool?
Following are the important Testing types which is supported by selenium,- Open source
- Easy to use
- Supports different OS
- Works with various browsers
- used for Android, iPhone, Blackberry etc. based application testing.
- very less CPU and RAM
30. What are the testing types that can be supported by Selenium?
Following are the important Testing types which is supported by selenium,- Functional Testing.
- Regression Testing.
- Sanity Testing.
- Smoke Testing.
- Responsive Testing.
- Cross Browser Testing.
- UI testing (black box)
- Integration Testing.
31. When should I use Selenium IDE?
- To increase the speed of test case creation.
- To edit, record and debug the tests
- For quick records
- To increase the speed of test case.
Book a Free Mock Interviews and Test your Selenium skills with our Experts
TOP MNC's SELENIUM INTERVIEW QUESTIONS & ANSWERS
Here we listed all Selenium Interview Questions and Answers which are asked in Top MNCs. Periodically we update this page with recently asked Questions, please do visit our page often and be updated in Selenium.
Related Blogs
To become a Selenium Certified professional and join in your dream company, Enroll now for our Best Selenium Training. We help you to crack any levels of Selenium Interviews and We offering Selenium Training with Placement Assistance.