Selenium
Selenium
SELENIUM
Selenium is a free, open-source automation tool used for
testing web applications across different browsers and
platforms.
8
Selenium Grid
Selenium Grid is a part of the Selenium Suite used to run
test cases on different machines, browsers, and operating
systems at the same time (parallel execution).
It helps perform cross-browser testing and distributed
testing efficiently.
We can create a Selenium Grid, where one server runs as the Hub, managing a
pool of Nodes.
1.You write a test script and send it to the hub.
2.The hub checks which node matches the required browser and
For example:
OS.
Firefox on Linux
3.The
Safari ontest is executed on that node, and results are sent back.
macOS
Chrome on Windows
Selenium Grid allows you to test on all of them simultaneously without switching systems.
Web Elements
Web elements are the basic building blocks of a web page. They
include both visible elements (like text, images, and buttons)
and invisible elements (like forms and metadata).
For example:
<html>
<body>
<form id="loginForm">
<label>Enter Username: </label>
<input type="text" name="Username"/>
<label>Enter Password: </label>
<input type="password" name="Password"/>
<input type="submit"/>
</form>
<a href="forgotPassword.html">Forgot Password ?</a>
</body>
</html>
Web Elements
rm>: The form element that collects the username and password.
bel>: Defines text labels for the input fields.
put type="text">: For entering the username.
put type="password">: For entering the password (it hides the input).
put type="submit">: A button to submit the form.
>: A hyperlink to the forgot password page.