Selenium Interview Questions for Freshers- 2024
These questions are included for both Freshers and Experienced professionals. Our Selenium Training has Answered all the below Questions.
1. Explain the Framework you are using
The most used important frameworks are,
2. What is data driven framework
Data Driven Framework is one of the popular Automation Testing Framework in the current market. Data Driven automated testing is a method in which the test data set is created in the excel sheet, and is then imported into automation testing tools to feed to the software under test. Selenium Webdriver is a great tool to automate web-based applications. But it does not support read and write operations on excel files
3. What is the HUB & Node?
Selenium Grid a Hub is a server or a central point that controls the test executions on different machines. Node is the machine which is attached to the hub. There can be multiple nodes in Selenium Grid.
4. Components of Framework
Following are the components of framework
5. How to count the links available in the form?
领英推荐
Use the below code for your reference:
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\\ghs6kor\\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();
}
}
Need to Switch your career to automation: Click Here
6. Different types of locators. Which locator is your preference and why?
Following are the different types of locators,
7. Syntax of Xpath and cssSelector
Syntax of Xpath
Xpath=//tagname[@attribute='value']
Syntax of cssSelector
node[attribute_name = ‘attribute_value’]
8. How do you run your test using a framework?
XPath in Selenium is an XML path used for navigation through the HTML structure of the page. It is a syntax or language for finding any element on a web page using XML path expression. XPath can be used for both HTML and XML documents to find the location of any element on a webpage using HTML DOM structure.
9. Conversion process of Testing report to XSLT
To generate XSLT report in Selenium be ready with below precondition.
10. Processor used in report
driver.switchTo().alert();
//Selenium-WebDriver Java Code for entering Username & Password as below:
driver.findElement(By.id("userID")).sendKeys("userName");
driver.findElement(By.id("password")).sendKeys("myPassword");
driver.switchTo().alert().accept();
driver.switchTo().defaultContent();