How To Explain Selenium Automation Framework

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

How to explain selenium automation framework

1 Program language : java

2. framework type :data driven framework, keyword driven, by using page object model

3. POM as per the page object Model, we have maintained a class for every web page. Each web page
has a separate class and that class holds the functionality and members of that web page. Separate
classes for every individual tests.

4. Packages. We have separate packages for pages and tests. All the web page related classes come
under the pages package and all the tests related classes come under tests package

5. Properties file config properties. Stores the information that remains static throughout the framework
such as browser specific information, application url, development, testing url, screenshots path,
security questions and answers username password, testing url etc

6. TestNg. Using TestNG for assertions, grouping and parallel execution

7. Screenshots: will be captured and stored in a separate folder and also the screenshots of failed test
cases will be added to the extent reports

8. Maven Using maven build for build execution and dependency purpose. Integrating the TestNG
dependency in the POM.xml file and running this POM using a CI/CD tool like Jenkins

9. Version Control Tool We use git as a repository to estore out scripts

1. What is TestNG? TestNG is a Testing framework that overcomes the limitations of another
popular testing framework called JUnit. The "NG" means "Next Generation." Most Selenium users
use this more than Junit because of its advantages. There are so many features of TestNG, but we
will only focus on the most important ones that we can use in Selenium. There are three major
advantages of TestNG over JUnit: Annotations are easier to understand Test cases can be grouped
more easily Parallel testing is possible

2. Mention five locators newly added in Selenium 4:

above: It is to locate a web element just above the specified element

below: It is to locate a web element just below the specified element

toLeftOf: It is to locate a web element present on the left of a specified element

toRightOf: It is to locate a web element present on the right of a specified element near: It is to locate
a web element at approx. 50 pixels away from a specified element. The distance can be passed as
an argument to an overloaded method.
3. What are the annotations available in TestNG?

@BeforeTest

@AfterTest

@BeforeClass

@AfterClass

@BeforeMethod

@AfterMethod

4. What is the importance of testng.xml file?

testng.xml file allows to include or exclude the execution of test methods and test groups It allows
to pass parameters to the test cases Allows to add group dependencies

6. How to disable a test case in TestNG ? To disable the test case we use the parameter

enabled = false to the @Test annotation. @Test(enabled = false)

7. How to Check Broken Links and Images?

For find out the broken links, you have to go through with the following steps:

Find all the links of the web page based on the a tag.

Send HTTP requests to all the links and read the HTTP response codes.

Based on the response code we can find out the valid and broken links based on the response code.

Iterate all the links one by one to get all the response code.

200 – valid Link

404 – Link Not Found

400 – Bad Request

401 – Unauthorized

500 – Internal error

8. How will you automate Image in selenium

Use sikuli Sikuli is a Graphical User Interface Automation Tool. Using Sikuli Automation tool we
could automate whatever we see on the screen. It basically uses image recognition technology to
identify and control GUI elements. We all know that using Selenium we cant automate windows
objects. Integrating Sikuli with Selenium allows us to overcome this issue. Using Sikuli with
Selenium, we could automate windows objects. Using Sikuli we could automate both Web and
Windows based applications.

10. What is the use of @TestinvocationCount=x?

The invocationcount attribute tells how many times TestNG should run a test method Java Scanner
class provides the nextLine method to facilitates line by line of file’s content.

12. Difference between Array and ArrayList? Array Array is static ArrayList is dynamic Size of the
array should be given at the time of array declaration. We cannot change the size of array after
creating it Size of the array may not be required. It changest the size dynamically. Capacity of
ArrayList increases automatically whenever we add elements to an ArrayList Array can contain both
primitive data types as well as object. ArrayList cannot contain primitive data types. It contains only
objects Arrays are multidimensional ArrayList is always single dimension

12. What is difference between Cherio and Node JS Cheerio : Cheerio is a Node.js module that is
built on the top of Core JQuery and its function. With Cheerio, we can use JQuery on the server-side.
Cheerio is capable enough to parse HTML and XML files.

2. Selenium : Selenium is an automation tool that is used to automate the browser. It is much more
powerful tool as compare to cheerio. Selenium provides a playback tool for authoring functional
tests without the need to learn a test scripting language so it is widely used for testing web
applications.

14. What are the common Myths about Testing Website Accessibility Myth 1: It’s expensive. Fact:
Precaution is always better than cure, so we can think of accessibility issues at the design stage
itself and reduce the cost.

You might also like