Selenium
Selenium
Assert:
The test fails and gets terminated whenever there is a fail in the check. That is the
Verify:
2. What is the difference between the Absolute path and the Relative Path?
Absolute Path:
This path starts from the root node and ends with the desired elements node.
It starts with a single slash (/)
Relative Path:
This path starts from any node in between and to the desired elements node.
It starts with a double slash (//)
findElement() :
It uses the given locating mechanism to find the first element within the current page
findElements():
It also uses the given locating mechanism to find all the elements within the current
driver.close():
driver.quit():
This command closes all the browser windows which are open
As we already know that Selenium is an automation testing tool that can work with only
web applications. Therefore, the pop-up in windows cannot be handled by Selenium. But,
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
Allows to add priorities to the test cases
Allows to configure parallel execution of test cases
Allows to parameterize the test cases
9. How to disable a test case in TestNG ?
To disable the test case we use the parameter enabled = false to the @Test annotation.
Feature File - It has plain text descriptions of single or numerous test situations.
Step Definition file - It has the extension .java. It essentially acts as a translator
between the test scenario steps provided in the feature file and the
automation code. Cucumber searches the step definition file and executes
the relevant functions that are assigned to that step when it runs a step
described in the feature file.
TestRunner: .java is the file extension for this file. It connects the feature file
and the step definition file. It allows the user to run one or more feature files
at the same time. It contains the locations of the step definition and feature
files.