0% found this document useful (0 votes)
9 views4 pages

Selenium Notes

Uploaded by

25dkx6jchf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Selenium Notes

Uploaded by

25dkx6jchf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Test NG: TestNG is a popular testing framework for Java that allows

users to perform automated testing for web applications.


TestNG is preferred by developers for its ability to write powerful test cases with the help of
annotations, grouping, and parametrizing. It covers all classifications of test automation like Unit
testing, Functional testing, End-to-End, and integration testing. It's available in the form of jar
files.

Jnuit : JUnit is a unit testing open-source framework for the Java programming language.
Java Developers use this framework to write and execute automated tests. In Java, there are
test cases that have to be re-executed every time a new code is added.

JavaScriptExecutor:
There are scenarios where the Webdriver commands will not work as expected due to various reasons. In
these cases, we take the help of JavaScriptExecutor.
For example, traditionally to locate a web element we use different web locator strategies such as ID,
Name, CSS selector, and XPath, etc. If these locators do not work as expected, or you are handling a
tricky XPath, you can use JavaScriptExecutor to perform the desired operation on the WebElement.
Driver Factory :

WebDriver by design is not thread safe so if you intend to have several threads to run different
webdriver instances you need to wrap them into ThreadLocal and most probably the "DriverFactory"
you're talking about is a helper class which initializes webdriver puts it to ThreadLocal.

Selectors and locators:


By id : driver.findElement(By.id(“example”))
By name driver.findElement(By.name(“example”))
By css selector
driver.findElement(By.cssSelector(“example”))
By xpath driver.findElement(By.xpath(“example”)) there
are two types of xpath relative and absolute
Absolute Xpath: It contains the complete path from the Root
Element to the desire element. It starts with a single slash ‘/’
Relative Xpath: This is more like starting simply by referencing the
element you want and go from the particular location. It is represented
by a double slash ‘//’ denoting the current node.

It is represented by a double slash '//' denoting the current node. It is


always preferred over an absolute XPath as it is not a complete path
from the root element

WHY DO WE NEED DRIVERS IN SELENIUM


As Google Chrome dominates the browser market, the use of a ChromeDriver becomes a must.
Selenium WebDriver uses the ChromeDriver to communicate test scripts with Google Chrome.
It is used to navigate between web pages and provide input to the same.
WE CAN ALSO TEST ON FIREFOX AND EDGE BROWSER WITH APPROPIATE
WEBDRIVER.
Element vs elements in selenium :
Element is used to capture a single value element is used when we want to fetch something
from a set of data like from an array.

Send keys:
Send keys is used to send any value in textfield or textbox syntax for this is
Driver.findelement.by.id(example).sendkeys(“taimoora”)

webElement:
web element is like we create variable in java
in java we use like int and then variable name
in selenium we write WebElement then variable name

to store any selector in that variable .


Example WebElement MRUMAR

DataTable :
Datatable is a process in which we can send any data or value through feature file
into application

In this case description is webelement in which selector is save of description page


and below it we are sending data to description section by data table.

Can we send data through feature file into function? Yes we can in which we have
to apply “ ” on the data which we want to send into function

You might also like