Mastering Software Testing Automation with Selenium: Flowcite – Academic Research Platform
Flowcite is a cutting-edge software platform that provides a comprehensive set of tools for academic research, writing, editing, and publishing. By seamlessly integrating the latest technologies for collaborative research and writing, Flowcite offers a unique all-in-one approach to academic research and writing.
Key Features of Flowcite
- LaTeX text editor
- Collaborative PDF viewer
- Grammar & Style checker
- Proofreading service
- AI Article summarizer
- Integrated book store
Automating a web application using Selenium typically involves interacting with the web elements on the pages. Below is a simplified example using Java with the Selenium library to demonstrate how you might automate some actions on Flowcite’s web application.
Prerequisites
- Download Selenium WebDriver:
Download the Selenium WebDriver for Java from the official Selenium website: Selenium Downloads - Download WebDriver for your Browser:
Download the WebDriver executable for the browser you intend to use. For example, ChromeDriver for Google Chrome. - Set Up Your Java Project:
Set up a new Java project in your favorite IDE (e.g., IntelliJ, Eclipse) and include the Selenium WebDriver JARs in your project. I’ve used Eclipse.
Finding Elements with XPath
There are 4 ways to use XPath in selenium:
- Using Absolute XPath
- Using Relative XPath
- XPath with Attributes
- XPath Axes
In the case of Flowcite, we have used XPath with Attributes. We had to create xpaths to be more specific as some of the time we faced the same class name for multiple elements. XPath supports various functions that you can use to manipulate strings, numbers, and other data types.
First, in the videos, you can see that we called the Selenium WebDriver elements. We initiated the process by navigating to the Flowcite login option and provided login credentials by calling the ID of the box element. Subsequently, we clicked on the login button using the XPath of the button.
Dashboard section
To Buy/purchase an item, we first created a web element and called it by class name to click on the corresponding button. After the pop-up appeared, we followed the same process to close the pop-up.
For the Pie chart’s filter checkboxes, a for loop was implemented to check and uncheck every box.
Now, focusing on Specific options in the sidebar:
For Library, Editor, Services, Search, and Trash, we created web elements and hovered over each element to reveal the new tab open button. Then, we selected the XPath of the button and set it to click, resulting in the opening of a new tab.
Regarding Profile, a web element was created and called by class name to click on the maximize button. Different XPaths were selected to open various options under the profile like Edit Profile, see Invoices, see the Subscription Table, Changing teme or Logout from the system.
Search
Now for Search, XPaths was selected from the selection button from the main search bar. For DOI select DOI and search with DOI number. For Plain text select Plain text and pass the text that I wanted to search with. Then select the XPath of the button and set it to click.
Then for Advanced search select a particular Year by selecting the XPath of the radio button and set it to click. Then select the year from the dropdown and again set it to click. Selected the Title box, Abstract, DOI number, and Publisher by their xpaths and passed the value. A more presided result will show.
With the xpath of the pdf button set it to click and open the PDF page in a new tab.
Library
On the Library page, first, we tried to create a project by calling it by class name to clicking on the corresponding button. Selected the Add Library button by ID name. Then a pop-up will open to create the project. Passed the name to the Project name box by selecting xpath. Then select the XPath of the Create button and set it to click.
Again select the Add Library button by ID name, but this time it will show a message about Limit.
After that by selecting the xpath of the project box set click on the box, and it will open the project page. After that, we clicked the upload image button by selecting the xpath of the button. Then manually selected the image in a time frame and clicked the upload button.
In the same process as the image upload, the document upload worked.
After that call the xpath of Tags and set click on that. The pop-up would appear and pass a random text in the Add tag box by calling the box by its xpath. Click on Add to add a new tag.
After creating a project, let’s delete it. From the Library page, call the xpath of the (…) button and set it for a click, a dropdown will open. Select the Delete option by its xpath and set it to click. The project will be deleted.
Editor
To create a new file from the Editor page, we called for the xpath of the Create File and set it to click. The create pop-up would open, then pass the text in the title box by selecting the xpath of the box. Selected the project from the dropdown by calling it xpath. Selected Blank Project by selecting the box’s xpath. Then select the Create button by its xpath and set it to click. The new project will be created and the file will open in latex.
Downloaded the file by calling the xpath of the Download button and setting it to click, then select the format from the dropdown by xpath of the format.
Added Image by calling the xpath of the Image button and setting it to click, then the pop-up will open to select an existing image or upload a new image. Here we’ve selected the existing image by selecting the image’s radio button xpath. The image will be uploaded.
Saved the file by calling the xpath of the Save button and set it to click. Passed text in the box and called the save button’s xpath to save the file.
Now the sidebar is visible on the very right. Selected the xpaths of the buttons and called them. The process will call the xpaths and it will go to PDF Viewer, Prowritting Aid, References, Citations, Notes, Markdowns, Web Resources, Images, and Guidelines. After going to the References and Citations we have called for one of the xpaths of the radio button for the shown references. It will add the reference or citation in the latex file.