Selenium Interview Questions for Freshers- 2024
Selenium Interview Questions fro Freshers- 2024

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,

  • Data-Driven Test Framework
  • Keyword Driven Test Framework
  • Hybrid Test Framework

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

  • Selenium IDE,
  • Selenium RC,
  • Selenium WebDriver,
  • Selenium RC

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,

  • 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

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.

  • Ant should be installed.
  • We should have atleast some test case should be executed by TestNG Processor used in report

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();

		        

要查看或添加评论,请登录

Priya M的更多文章

社区洞察

其他会员也浏览了