TYCS Manual STQA
TYCS Manual STQA
TYCS Manual STQA
1) Install Selenium IDE and create a test suite containing a minimum of 4 test cases for different
web page formats (e.g., HTML, XML, JSON, etc.).
2) Conduct a test suite for two different websites using Selenium IDE. Perform various actions
like clicking links, filling forms, and verifying content.
3) Install Selenium Server (Selenium RC) and demonstrate its usage by executing a script in Java
or PHP to automate browser actions.
4 )Write a program using Selenium WebDriver to automate the login process on a specific web
page. Verify successful login with appropriate assertions.
5) Write a program using Selenium WebDriver to update 10 student records in an Excel file.
Perform data manipulation and verification.
6) Write a program using Selenium WebDriver to select the number of students who have
scored more than 60 in any one subject (or all subjects). Perform data extraction and analysis.
7) Write a program using Selenium WebDriver to provide the total number of objects present or
available on a web page. Perform object identification and counting.
8) Write a program using Selenium WebDriver to get the number of items in a list or combo box
on a web page. Perform element identification and counting.
9 )Write a program using Selenium WebDriver to count the number of checkboxes on a web
page, including checked and unchecked counts. Perform checkbox identification and counting.
10) Perform load testing on a web application using JMeter. Generate and analyze load
scenarios. Additionally, explore bug tracking using Bugzilla as a tool for logging and tracking
software defects.
Practical no.1
Aim:- Install Selenium IDE and create a test suite containing a minimum of 4 test cases for
different web page formats (e.g., HTML, XML, JSON, etc.).
What is Selenium?
Selenium is an open-source suite of tools and libraries that is used for browser automation.
Selenium us used to:
It provides a single interface that lets you write test scripts in programming languages like Ruby,
Java, NodeJS, PHP, Perl, Python, JavaScript, and C#, among others. Selenium is very extensible
and can be integrated with other tools and frameworks like TestNG, JUnit, Cucumber, etc.
Selenium allows developers and testers to automate the testing of web applications across
different browsers and platforms.
1. Language Support: Selenium allows you to create test scripts in different languages
like Ruby, Java, PHP, Perl, Python, JavaScript, and C#, among others.
2. Browser Support: Selenium enables you to test your website on different browsers such
as Google Chrome, Mozilla Firefox, Microsoft Edge, Safari, Internet Explorer (IE), etc.
3. Scalability: Automated testing with Selenium can easily scale to cover a wide range of test
cases, scenarios, and user interactions. This scalability ensures maximum test coverage of the
application’s functionality.
4. Reusable Test Scripts: Selenium allows testers to create reusable test scripts that can be
used across different test cases and projects. This reusability saves time and effort in test
script creation and maintenance.
5. Parallel Testing: Selenium supports parallel test execution, allowing multiple tests to run
concurrently. This helps reduce the overall testing time, making the development process
more efficient.
6. Documentation and Reporting: Selenium provides detailed test execution logs and reports,
making it easier to track test results and identify areas that require attention.
7. User Experience Testing: Selenium can simulate user interactions and behavior, allowing
testers to assess the user experience and ensure that the application is intuitive and user-
friendly.
Components of Selenium
1. Selenium IDE
2. Selenium RC
3. Selenium WebDriver
4. Selenium Grid
Selenium IDE
Steps to perfom:-
o Command : open
o Target : https://www.google.co.in
o During execution of the test case, this command will load the Google search engine web
page on your Firefox browser
There are several features provided in the IDE under the toolbar, using which one can control the
execution of test cases
It is used to test the two different websites using Selenium IDE and we observe the clicking and
filling form and verifying the content
E-commerce websites are the most complex and intricate websites out there. This is due to their
navigation, product categorization, preview functionalities, and key features like payment
gateway integrations.
So it is non-negotiable while developing eCommerce websites to undergo rigorous testing,
ensuring all the functionalities work together in harmony without affecting the user experience.
Now that we have the different types of testing applicable, it’s time to delve into the sample test
cases for ecommerce website. To create practical test cases for ecommerce website, one must
understand the structure of a typical site.
There are many features in an eCommerce website – hero carousel/slider, search, filter, product
details, payments, checkout, etc. each having a pre-defined functionality.
For example, Every search bar should show relevant results, i.e., searching for electronics should
show all categories like mobiles, TVs, cameras, etc.
General Test Cases
The user should be able to navigate to all the pages in the website
There should be a fallback page for any page load errors
Verify that all the links and banners work properly
Search results should be displayed with the most relevant item being shown first
All data related to the product – title, price, images, and description are all visible clearly
Maintain a session for each user and test verify the session times out after a while
Practical no.3
Aim:- Write a program using Selenium WebDriver to automate the login process on a specific
web page. Verify successful login with appropriate assertions.
The total number of links in a page can be counted with the help of findElements() method. The
logic is to return a list of web elements with tag name anchor, then getting the size of that list.
To count the total number of web elements in the web page using Selenium for Java, find
elements using XPath with expression to match any web
element. driver.findElements(By.xpath("//*")) returns a list containing all the web elements
present in the web page. Call size() on this list, and it returns the number of elements in the web
page.
The following is a simple code snippet to get the total number of elements in the web page.
To address the issue of counting elements in a dynamic list, there are two solutions to consider.
Alternatively, suggests creating a list of elements in your table by selecting a row with
the appropriate selector, and then using the FindElements() method in Selenium to
return a List of web elements. The xpath of the first form element in the HTML should be used as
Valid_Xpath.Count number of a class objects created in Java, The idea is to use static member in
the class to count objects. A static member is shared by all objects of the class, all static data is
initialized to zero when the first object is created if no other initialization is present,
And constructor and static member function can only access static data member
Practical no 5
Write a program using Selenium WebDriver to update 10 student records in an Excel file.
Perform data manipulation and verification.
Apache POI (Poor Obfuscation Implementation) is a powerful Java API developed by the
Apache Software Foundation. It offers assistance with Excel, Word, and PowerPoint file types as
well as reading, writing, and editing other Microsoft Office file formats. To generate, alter, and
extract data from Office documents, Java developers can use Apache POI to communicate
programmatically with various file formats.
Since working with Excel files is Apache POI's primary goal, it is a popular option for data-
driven testing in automation frameworks like Selenium. It gives developers access to a wide
range of classes and interfaces that abstract away the underlying file formats and lets them
manipulate Excel workbooks, worksheets, rows, and cells in a variety of ways.
Create an Instance of the Workbook Class and Create a New Excel File.
Code
Explanation In this step, you create a new instance of the Workbook class, specifically
the XSSFWorkbook implementation for .xlsx files. This creates a new in-memory workbook
object. Then, you create a new sheet within the workbook using the createSheet() method and
provide a name for the sheet, such as Sheet1.
Code
Explanation Here, you create a Row object within the sheet using the createRow() method,
passing the row index as the parameter. In this example, we create a row at index 0. Then, you
create a Cell object within the row using the createCell() method and pass the cell index as the
parameter.
In this case, we create a cell at index 0 of the row. Finally, you set the cell value using
the setCellValue() method. You can provide any desired value, such as Hello, World!.
3. Create a File Output Stream and Write the Workbook Data to a File.
Code
Explanation In this step, you create a FileOutputStream object to specify the file where you
want to write the data. You provide the file path as a parameter. Then, you use
the write() method of the Workbook class to write the workbook data to the file specified by
the FileOutputStream object.
Code
workbook.close();
file.close();
Explanation Finally, after writing the data, you need to close the workbook and the
FileOutputStream to release system resources.
Remember to handle exceptions and perform appropriate error handling as necessary. You can
add try-catch blocks to handle IOExceptions that may occur during file operations.
By following these steps, you can successfully write data to an Excel file in Selenium using
Apache POI. This can be useful for scenarios such as populating test data, generating reports, or
creating data-driven test cases in your automation scripts.