Web tables, also known as HTML tables, are a widely used format for displaying data on web pages. They allow for a structured representation of information in rows and columns, making it easy to read and manipulate data. Selenium WebDriver, a powerful tool for web browser automation, provides the functionality to interact with these tables programmatically. This capability is beneficial for tasks like web scraping, automated testing, and data validation. In this blog, we will see how to extract data from Web tables in Java-Selenium.
Identify web table from your webpage:
To effectively identify and interact with web tables using Selenium, it’s crucial to understand the HTML structure of tables and the specific tags used. Here’s an overview of the key table-related HTML tags
A typical HTML table consists of several tags that define its structure:
<table>: The main container for the table.
<thead>: Defines the table header, which contains header rows (<tr>).
<tbody>: Contains the table body, which includes the data rows.
<tr>:Defines a table row.
<th>: Defines a header cell in a table row.
<td>: Defines a standard data cell in a table row.
As a demo website, here you will get a sample WebTable with fields like first name, last name, email, etc. Here we have applied a filter for email to minimize the size of the table.
We will be starting by launching the browser and navigating to the webpage. We have applied a filter for the email “PolGermain@whatever.com”, you can change it as per your requirement.
Once we get the filtered data from the table, now we need to locate the table and get the number of rows. The table will have multiple rows so, we need to use a list to store all the rows.
As we have stored all the rows in the list, now we need to iterate through each rows to fetch the columns and store the column data in another list.
Example :
Abc
1
Xyz
2
table has 2 rows and 2 columns
When we are iterating through the 1st row we will get data as Abc and 1 and store it in the list ’as rowdata[Abc, 1] similarly data from the 2nd row will be stored as rowdata[Xyz, 2].When we are iterating through the 2nd row the data from the 1st row will be overwritten. That’s why we will need one more list ‘webRows ’ to store all the rows. In the below code snippet, here we are iterating through all the columns from each row one by one and finally storing all the rows in the list WebRows.
We have successfully extracted the table data now you can use this data as per your requirement
To do this we need to iterate through the list ‘webRows’ where we have our table data stored. We will be accessing all the columns by their index. In this case, you should know the column index you want to access. The column index always starts from 0.
for (int s = 0; s < webRows.size(); s++) {
List<String> row = webRows.get(s);
System.out.println(row.get(1));
System.out.println(row);
}
Below is the complete code snippet for the above-mentioned steps. You need to update related Xpaths in case you are not able to access the rows and columns with the given Xpaths.
Instead of accessing data by the index, you can access it using the column index also, and to do that you need to use the HashMaps instead of lists. HashMap will help to store column headers as keys and column data as values
Example:
Name
Id
Abc
1
Xyz
2
Table has 3 rows and 2 columns
Here Name and ID will be your keys and Abc, 1 and Xyz, 2 will be the values.
How to store and access table data using HashMap?
The code snippet below shows how to use HashMap to store data in key-value format.
package Selenium;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.ArrayList;
import java.util.List;
public class Webtable_Blog {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("https://www.globalsqa.com/angularJs-protractor/WebTable/");
driver.manage().window().maximize();
WebElement global_search = driver.findElement(By.xpath("//input[@type='search' and @placeholder='global search']"));
global_search.sendKeys("PolGermain@whatever.com");
// global_search.sendKeys("Pol");
global_search.sendKeys(Keys.ENTER);
Thread.sleep(5000);
List<WebElement> rows = driver.findElements(By.xpath("//table[@class='table table-striped']/tbody/tr"));
System.out.println("size-"+rows.size());
List<Map<String, String>> webRows = new ArrayList<>();
for (int i = 0; i < rows.size(); i++) {
List<WebElement> keys = driver.findElements(By.xpath("//table[@class='table table-striped']/thead/tr[1]/th"));
List<WebElement> values = driver.findElements(By.xpath("//table[@class='table table-striped']/tbody/tr["+(i+1)+"]/td"));
Map<String, String> webColumn = new HashMap<>();
try {
for (int j = 0; i < keys.size(); j++) {
webColumn.put(keys.get(j).getText(), values.get(j).getText());
}
} catch (Exception e) {
}
webRows.add(webColumn);
}
for (int s = 0; s < webRows.size(); s++) {
System.out.println(webRows.get(s).get("lastName"));
System.out.println(webRows.get(s));
}
}
}
In this blog, we’ve delved into the powerful capabilities of Selenium WebDriver for handling web tables in Java. WebTables are a crucial part of web applications, often used to display large amounts of data in an organized manner. In Java Selenium, handling these WebTables efficiently is a key skill for any test automation engineer. Throughout this blog, we’ve explored various techniques to interact with WebTables, including locating tables, accessing rows and cells, iterating through table data, and performing actions like sorting and filtering.
Click here for more blogs on software testing and test automation.
Priyanka is an SDET with 2.5+ years of hands-on experience in Manual, Automation, and API testing. The technologies she has worked on include Selenium, Playwright, Cucumber, Appium, Postman, SQL, GitHub, and Java. Also, she is interested in Blog writing and learning new technologies.
Working with PDF documents programmatically can be a challenging task, especially when you need to extract and manipulate text content. However, with the right tools and libraries, you can efficiently convert PDF text to a structured JSON format.
Converting PDF to JSON programmatically offers flexibility and customization, especially in dynamic runtime environments where reliance on external tools may not be feasible. While free tools exist, they may not always cater to specific runtime requirements or integrate seamlessly into existing systems.
Consider scenarios like real-time data extraction from PDF reports generated by various sources. During runtime, integrating with a specific tool might not be viable due to constraints such as security policies, network connectivity, or the need for real-time processing. In such cases, a custom-coded solution allows for on-the-fly conversion tailored to the application’s needs.
For Example:
E-commerce Invoice Processing: Extracting invoice details and converting them to JSON for real-time database updates.
Healthcare Records Management: Converting patient records to JSON for integration with EHR systems, ensuring HIPAA compliance.
Legal Document Analysis: Extracting specific clauses and dates from legal documents for analysis.
Free tools are inadequate for real-time, automated, and secure PDF to JSON conversion. Coding your own solution ensures efficient, scalable, and compliant data handling.
In this blog, we’ll walk through a Java program that accomplishes using the powerful iTextPDF and Jackson libraries. Screenshots will be included to illustrate the process in Testing.
Introduction for Converting PDF to JSON in Java
PDF documents are ubiquitous in the modern world, used for everything from reports and ebooks to invoices and forms. They provide a versatile way to share formatted text, images, and even interactive content. Despite their convenience, PDFs can be difficult to work with programmatically, especially when you need to extract specific information from them.
Often, there arises a need to extract text content from PDFs for various purposes such as:
Data Analysis: Extracting textual data for analysis, reporting, or further processing.
Indexing: Creating searchable indexes for large collections of PDF documents.
Transformation: Converting PDF content into different formats like JSON, XML, or CSV for interoperability with other systems.
JSON (JavaScript Object Notation) is a lightweight data interchange format that’s easy for humans to read and write, and easy for machines to parse and generate. It is widely used in web applications, APIs, and configuration files due to its simplicity and versatility.
In this guide, we will explore how to convert the text content of a PDF file into a JSON format using Java. We’ll leverage the iTextPDF library for PDF text extraction and the Jackson library for JSON processing. This approach will allow us to take advantage of the structured nature of JSON to organize the extracted text in a meaningful way.
Prerequisites for Converting PDF to JSON in Java
Before we dive into the code, ensure you have the following prerequisites installed and configured:
Java Development Kit (JDK)
Maven for managing dependencies
iTextPDF library for handling PDF documents
Jackson library for JSON processing
Step-by-Step Installation and Setup for Converting PDF to JSON in Java
Install Java Development Kit (JDK)
The JDK is a software development environment used for developing Java applications. To install the JDK:
Start IntelliJ IDEA: Open from the start menu (Windows).
Complete Initial Setup: Import settings or start fresh.
Start a New Project: Begin a new project or open an existing one.
Open IntelliJ IDEA:
Launch IntelliJ IDEA on your computer
Create or Open a Project
If you already have a project, open it. Otherwise, create a new project by selecting File > New > Project….
Name your project and select the project location
Choose Java from Language.
Choose Maven from the Build systems.
Select the project SDK (JDK) and click Next.
Choose the project template (if any) and click Next.
Then click Create.
Create a New Java Class
In the Project tool window (usually on the left side), right-click on the (src → test → java) directory or any of its subdirectories where you want to create the new class.
Select New > Java Class from the context menu.
Name Your Class
In the dialog that appears, enter the name of your new class. For example, you can name it PdfToJsonConversion.
Click OK/Enter.
Add the following dependencies to your pom.xml file for Converting PDF to JSON in Java:
<dependencies>
<!-- https://mvnrepository.com/artifact/com.itextpdf/itext-core -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-core</artifactId>
<version>8.0.3</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.0</version> <!-- Use the same version for consistency -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.1</version> <!-- Use the latest version available -->
</dependency>
<!-- Jackson Annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.13.3</version> <!-- Use the latest version available -->
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.8.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Write Your Code to Convert PDF to JSON in Java
IntelliJ IDEA will create a new .java file with the name you provided.
You can start writing your Java code inside this file.
The Java Program to Covert PFT to JSON
Here is the complete Java program that converts a PDF file to JSON:
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.pdf.canvas.parser.PdfTextExtractor;
import org.testng.annotations.Test;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class PdfToJsonConversion {
@Test
public static void convertPdfFileToJson() {
String inputPdfPath = "C:\\Users\\Mangesh\\Downloads\\What is Software Testing.pdf";
String outputJsonPath = "src/test/java/What is Software Testing.json";
List<String> contentList = new ArrayList<>();
try (PdfDocument pdfDoc = new PdfDocument(new PdfReader(inputPdfPath))) {
int numPages = pdfDoc.getNumberOfPages();
for (int i = 1; i <= numPages; i++) {
PdfPage page = pdfDoc.getPage(i);
String pageContent = PdfTextExtractor.getTextFromPage(page);
contentList.add(pageContent);
}
} catch (IOException e) {
e.printStackTrace();
}
// Create JSON object
ObjectMapper mapper = new ObjectMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
ArrayNode pagesArray = mapper.createArrayNode();
// Add page contents to JSON array
for (int i = 0; i < contentList.size(); i++) {
ObjectNode pageNode = mapper.createObjectNode();
pageNode.put("Page", i + 1);
// Split content by lines and add to JSON object with line number as key
String[] lines = contentList.get(i).split("\\r?\\n");
ObjectNode linesObject = mapper.createObjectNode();
for (int j = 0; j < lines.length; j++) {
linesObject.put(Integer.toString(j + 1), lines[j]);
}
pageNode.set("Content", linesObject);
pagesArray.add(pageNode);
}
File outputJsonFile = new File(outputJsonPath);
// Write JSON to file
try {
mapper.writeValue(outputJsonFile, pagesArray);
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Content stored in " + outputJsonFile.getName());
}
}
Explanation
Let’s break down the code step by step:
1. Dependencies
Jackson Library:
ObjectMapper, SerializationFeature, ArrayNode, ObjectNode: These are from the Jackson library, used for creating and manipulating JSON objects.
iText Library:
PdfDocument, PdfPage, PdfReader, PdfTextExtractor: These classes are from the iText library, used for reading and extracting text from PDF documents.
TestNG Library:
@Test: An annotation from the TestNG library, used for marking the convertPdfFileToJson method as a test method.
Java Standard Library:
File, IOException, ArrayList, List: Standard Java classes for file operations, handling exceptions, and working with lists.
2. Test Annotation
The class PdfToJsonConversion contains a static method convertPdfFileToJson which is annotated with @Test, making it a test method in a TestNG test class.
3. Method convertPdfFileToJson:
This method handles the core functionality of reading a PDF and converting its content to JSON.
4. Input and Output Paths:
inputPdfPath specifies the PDF file location, and outputJsonPath defines where the resulting JSON file will be saved.
5. PDF to Text Conversion:
Create a PdfDocument object using a PdfReader for the input PDF file.
Get the number of pages in the PDF.
Loop through each page, extract text using PdfTextExtractor, and add the text to contentList.
Handle any IOException that may occur.
6. Creating JSON Objects:
Create an ObjectMapper for JSON manipulation.
Enable pretty printing with SerializationFeature.INDENT_OUTPUT.
Create an ArrayNode to hold the content of each page.
7. Adding Page Content to JSON:
Iterate over contentList to process each page’s content.
For each page, create an ObjectNode and set the page number.
Split the page content into lines, then create another ObjectNode to hold each line with its number as the key.
Add the linesObject to the pageNode and then add the pageNode to pagesArray.
8. Writing JSON to File
Create a File object for the output JSON file.
Use the ObjectMapper to write pagesArray to the JSON file, handling any IOException.
Print a confirmation message indicating the completion of the process.
9. Output
The program outputs the name of the JSON file once the conversion is complete.
Running the Program
To run this program, ensure you have the required libraries in your project’s classpath. You can run it through your IDE or using a build tool like Maven.
Open your IDE and load the project.
Ensure dependencies are correctly set in your pom.xml.
Run the test method convertPdfFileToJson.
You should see output similar to this in your console: Content stored in What is Software Testing.json. The JSON file will be created in the specified output path.
JSON Output Example
Here’s a snippet of what the JSON output might look like.
[ {
"Page" : 1,
"Content" : {
"1" : "What is Software Testing? ",
"2" : "Last Updated : 24 May, 2024 ",
"3" : " ",
"4" : " ",
"5" : "",
"6" : "Software testing can be stated as the process of verifying and validating whether a ",
"7" : "software or application is bug-free, meets the technical requirements as guided by "
}
}, {
"Page" : 2,
"Content" : {
"1" : " Increased customer satisfaction: Software testing ensures reliability, security, ",
"2" : "and high performance which results in saving time, costs, and customer "
}
} ]
Conclusion
Converting PDF text content to JSON can greatly simplify data processing and integration tasks. With Java, the iTextPDF, and Jackson libraries, this task becomes straightforward and efficient. This guide provides a comprehensive example to help you get started with your own PDF to JSON conversion projects. https://github.com/mangesh-31/PdfToJsonConversion
Hello! I’m Mangesh, a Software Tester SDET. In my professional life, I focus on ensuring the quality of software products through thorough testing and analysis. I have been learning and working with Selenium, Java, and Playwright to develop automated testing solutions. Currently, I am working Jr. SDET at SpurQLabs Technologies Pvt. Ltd.
Mobile App Automation using Appium involves various ways to locate elements for effective testing. In this blog, we’ll se the Mobile app automation Using Appium Inspector, we can inspect elements on both iOS and Android devices.
Now we’ll go for locating the Android Element
Mobile App Testing tools are available in the market right now are as follows:
Katalon
Appium
Espresso
XCTest
Robotium
Selndroid
Flutter
Robot Framework
iOS-driver
Xamarin
So currently we are going to Inspecting the Locator Strategy for Mobile App Automation using Appium, For the initial setup of Appium for Android device you can refer this blog How To Configure Our System For Real Mobile App Automation. This blog will guide you for the mobile app automation using Appium setup on Android device.
We have various ways to locate the elements for mobile app automation using Appium Inspector, mainly we have the following ways to locate the elements:
Id
Xpath
Customized Xpath
Accessible Id
First, we’ll see how to locate the specific element for Mobile App Automation using Appium
After starting the session on an Android phone you will see the below Appium inspector window
In this image, you can see the mobile screen, App source, and Selected Element tabs.
When you select the particular element on the mobile screen displayed on Appium Inspector, You will see the below image, I have selected the C button from a calculator for mobile app automation using appium.
Now we can see the DOM content is loaded in the App Source tab, and the Attributes and values will be displayed in the Selected Element tab.
Now we’ll see how to locate the element from the Selected Element tab.
In the above image you can see the attribute and values to locate the element
Now we can see the Locator strategies to locate this element for mobile app automation using appium. First, we’ll see locating the element using the Id
First, we’ll have to see the available Attributes for that particular element and then try to locate the element. So copy the ID from given Selected Element tab as shown below
So now We’ll see how to check whether the Id is a valid locator or not.
For that first click on the Search bar
Then make sure you have selected the correct locator Strategy as shown in the below image.
Now after clicking on the search element, you will get to see the identified element as shown in the below image
As the element is getting highlighted it indicated that we can use that ID to locate that particular element
Now we’ll see locating elements using XPath for Mobile App Automation using Appium
In a similar way to Id we can locate the element using Xpath, So for first we need to click on the Xpath shown in the below image.
Now click on the search button explained above
Make sure that you have selected the XPath as Locator Strategy as shown. Then Paste the copied XPath in the Selector Box and click on the Search Button, so then you can see the below image the element is located by the XPath
The element is getting highlighted and that means we can use this XPath to locate this element
Now we’ll see how to use customized XPath for Mobile App Automation
This allows us to handle parameterization and overcome limitations when ID or XPath is not available by default. So for that, we need to know how we can create XPath
The first step is you need to find the class for that particular element
As you can see the above image, class is present for that particular element. So first step is we need to copy this class value
The next step is to choose the attribute you want to use the value of.
These are the various attributes you can use to customize XPath
So after that, you can create the Customized XPath, So here is a sample XPath I have used to locate the equal button from the Calculator app
In this XPath, I have chosen text attribute. So in the below image, you can see the combination of class and attribute and value. This is how we can create customized XPath
As shown in the below image you can see the Located element
So when the requirement is there to create a parameterized locator or ID is not available, at that time you can use Customized XPath
For accessibility Id you can follow similar steps like ID to locate the element. The only condition is Accessibility ID should be available for that particular element
Now we’ll go for locating the iOS element for Mobile App Automation using Appium
For iOS automation We’ll be going to see how we can locate the element. To locate elements on iOS devices following strategies are available
Accessibility Id
XPath
Customized XPath
Now we’ll see how to locate the element using Accessibility ID on iOS device.
For that, we’ll have to start the Appium Session on iOS. After starting the Appium session on iOS device you will get to see the below window of Appium inspector
This will be the home page of the calculator on the iOS App. On this screen, you can see three windows Mobile screen, App Source, and Selected Element. When you select any of the elements displayed on the Mobile screen the screen will be shown below.
In the above Image, I have selected the AC button which is for All Clear. After selecting that element the DOM content is loaded in the App Source window and in the Selected Element window we can see the attributes and values that can be used for inspecting the elements.
We have so many options to locate the element as you can see in the Selected Element window. We have accessibility ID, XPath, and customized XPath for Mobile App Automation using Appium.
Now we’ll see how to locate the element using accessibility id for Mobile App Automation using Appium
So first we’ll go to search for element as shown in the below image
As shown in the above image you can see that I have selected Locator Strategy as the Accessibility ID and the value I have passed the accessibility ID got from the Selected Element window. Now, I’ll click on the Search button.
The system will display the result window below.
As shown in the screenshot, the AC button is highlighted after successfully finding the window element. The count for the found element is 1, and you can use this accessibility ID to locate this specific element.
Note: So for locating the elements using XPath and customized XPath you can refer the steps mentioned for Android.
Preffered Locator Strategy: As you can see the Selected element window, We have multiple options to locate the element for Mobile App Automation. So there might be a confusion to select the correct locator strategy. So here are some key points which you can consider while choosing the locator strategy
Most preferred locator strategy will be id (Android) or accessibility id (iOS). Because id’s are designed to be unique for direct access.
name locator strategy can be used if the particular element have the unique name which can be used to locate element.
The XPath are more likely to use if id not available or we have requirement to create locator which needs to be parameterized.
Conclusion:
As we see, we have multiple ways to locate the elements on the Mobile Application. Here in this blog, we got to know the the locator strategies to locate the elements on Android and iOS Application for Mobile App Automation using Appium. So you have multiple options to locate the elements, From which you have to decide which strategy suits best for your requirements. So as mentioned above id is fastest way to locate elements, But you have choice to use XPath and customized XPath for parameterization. https://github.com/appium/appium-inspector/releases
Overall, this blog provides an overview of how to locate elements Mobile App Automation using Appium Inspector. Additionally, it explains the various locator strategies you can choose based on the requirements of your test script.
Swapnil is an SDET with 1+ years of hands-on experience in Manual, Automation, and API testing. The technologies I have worked on include Selenium, Playwright, Cucumber, Appium, Postman, SQL, GitHub, Java, and Python. Also, I love Blog writing and learning new technologies.
Setting up Appium for testing on real devices for android app automation can be tricky. Many testers struggle with installing the right software, setting environment variables, and connecting their devices properly. These issues can cause a lot of frustration and slow down the testing process.
In this blog, we’ll make it easy for you. We’ll walk you through each step, from installing necessary software like the Java Development Kit (JDK) and Android Studio, to setting up your Android device for android app automation. We’ll also show you how to install Appium, configure it correctly, and use tools like Appium Inspector to interact with your app.
By following this simple guide, you’ll be ready to test your mobile apps on real devices quickly and efficiently.
What is Appium testing in Android App Automation
Appium is an open-source automation tool used for testing mobile applications. It allows testers to automate native, hybrid, and mobile web applications on iOS and Android platforms using the WebDriver protocol. Appium provides a unified API (Application Programming Interface) that allows you to write tests using your preferred programming language (such as Java, Python, JavaScript, etc.) and test frameworks. It supports a wide range of automation capabilities, including gestures, device rotation, multi-touch actions, and handling various types of mobile elements. Appium enables cross-platform testing, where the same tests can be executed on multiple devices, operating systems, and versions, providing flexibility and scalability in mobile app testing or android testing.
Advantages of Using Appium in Android App Automation:
Appium is an open source and free tool available for testers and developers.
Appium supports both real device and emulators/simulators testing.
Appium is compatible with popular testing frameworks and tools, making it easy to integrate into existing testing workflows and environments.
Advantages of using real device for Android App Automation:
Real device allows you to check your application under different network like 2G,3G,4G and 5G.
Using real device we can test hardware specific features like GPS, fingerprint and camera.
Using a real device provides more accuracy by taking some factors into consideration like device battery, processor, memory and device size.
Step→1
Install Java Development Kit (JDK):
Download and install the latest JDK from the official Oracle website.
Set JAVA_HOME as environment variable.
Also add jdk’s bin folder path in Path environment variable.
Step→2
Install Android Studio:
Download and install Android Studio from the official Android website.
After successful installation now we will set the ANDROID_HOME environment variable.
Also put platform tools path in path variable.
Now open cmd and run adb in command line and it should get executed successfully.
Step→3
Install Node.js:
If you haven’t already installed Node.js, you can download and install it from the official Node.js website.
Once the installation is complete check node version using command node -v also npm -v.
Step→4
Install Appium for real device testing using command npm install -g appium in command line:
Verify appium version using appium -v in command line.
Now run the command appiumin command line using this command your server should start and we are ready to do testing.
Step→5
Install Appium for real device testing using command npm install -g appium in command line:
Now run appium-doctor in command lineto check weather every dependency required for appium has been installed successfully.
Step→6
Now we need to install UIAutomator driver which allows to interact with the UI elements of Android apps during automated testing. It provides improved stability and performance compared to the original UIAutomator driver. To install it use this command appium driver install uiautomator2 in command line.
Step→7
Now for real device testing we also need to make some changes on device side too so we need to enable developer option for this:
Open setting and click on about phone.
Click on software information.
Click on Build number 5 times to enable developer mode.
Now once this option is enabled we need to enable usb debugging option as well.
Note: Above information to enable the developer mode its for SAMSUNG device it will be different for other device type.
What is Appium Inspector in Android App Testing?
Appium inspector is a tool which provides testers with a graphical user interface for inspecting and interacting with elements within mobile applications.
Step→8
Install appium inspector for windows using below link appium inspector.
Step→9
Start the appium session using command appium -a 127.0.0.1 -p 4723
Alternatively we can use appium GUI Appium GUI to start the server
i. Enter the host as 127.0.0.1
ii. Enter port number as 4723
iii. If you are using Appium GUI for start server.we need to also add remote path for Appium inspector
Step→10
Open the appium inspector enter remote host as 127.0.0.1 and port as 4723.
Configuring Desired Capabilities using Appium for Android App Automation:
When setting up automation with Appium for Android devices, it’s crucial to define the desired capabilities appropriately. These capabilities act as parameters that instruct Appium on how to interact with the device and the application under test.
deviceName: This parameter specifies the name of the device being used for testing. It’s essential to provide an accurate device name to ensure that Appium connects to the correct device.
udid: The Unique Device Identifier (UDID) uniquely identifies the device among all others. Appium uses this identifier to target the specific device for automation. Make sure to input the correct UDID of the device you intend to automate.
platformName: Here, the platform name is set to “Android,” indicating that the automation is targeted towards the Android platform.
platformVersion: This parameter denotes the version of the Android platform installed on the device.
automationName: Appium supports multiple automation frameworks, and here, “UiAutomator2” is specified as the automation name. UiAutomator2 is a widely used automation framework for testing Android apps.
appPackage: The app package is the unique identifier for the application under test. It’s essential for Appium to know which app to launch and interact with during automation.
appActivity: This parameter specifies the main activity of the application that needs to be launched.
For device udid run adb device command in command line
For device name and version we can check software information from android settings
For application package and appActivity we can download Apk Info application from play store
For application bundle Id and App activity
Step→11
Once you enter the remote host and port number enter below capabilities to open calculator application from your android devic for android testing.
The images below illustrate how I started the Appium server using the Appium GUI and successfully opened the Calculator app in Appium Inspector with the specified capabilities and now it’s ready to inspect your app to prepare for automated testing efficiently.
Conclusion:
Setting up Appium for testing on real Android devices can initially seem daunting due to the numerous steps involved and the technical nuances of configuring software and environment variables. However, by following this step-by-step guide, the process becomes manageable and straightforward.
Investing the time and effort to configure Appium correctly pays off by significantly enhancing the efficiency and effectiveness of your mobile testing strategy. This setup not only improves the
Click here for more blogs of software testing and test automation.
Junior Software Development Engineer in Test (JR. SDET) with 1 year of hands-on experience in automating and testing mobile applications using Python and Appium. Proficient in Selenium and Java, with a solid understanding of real device testing on both iOS and Android platforms. Adept at ensuring the quality and performance of applications through thorough manual and automated testing. Skilled in SQL and API testing using Postman.
After spending years in the software testing field, many SDETs/Test Engineers showcase strong technical abilities and hard work. However, despite their skill and effort, some may find themselves feeling undervalued, lacking the recognition and success they had hoped for, highlighting the importance of software testing skills.
Conversely, there are also SDETs/Test Engineers who possess solid technical knowledge and have rapidly gained recognition for their contributions, resulting in significant career advancement. What do you believe sets them apart? Could it be luck, connections, a positive reputation with seniors, or another factor?
Indeed, a crucial distinction lies between the two categories. Individuals in the first group solely emphasize technical skills and hard work, while those in the second group strike a balance between technical expertise and soft skills, allowing them to work smartly.
But what exactly are these soft skills, and why are they pivotal for career growth?
Absolutely, Technical skills are undoubtedly paramount as they form the solid foundation upon which one’s expertise is built. Without acquiring strong technical skills, initiating or sustaining a career in the long run can prove to be quite challenging.
However, it’s essential to recognize that these technical skills must be complemented by Soft skills to maximize outcomes and achieve goals within optimized timelines. Just like hand in hand, the synergy between Technical and Soft skills fosters excellence in work and facilitates goal attainment.
By now, it’s evident that Soft Skills hold immense significance not only in the software testing field but also across various other domains. Despite their importance, these skills are often overlooked amidst work pressure, tight deadlines, and a focus on problem-solving or achieving test results.
Let’s delve into some of the most common Soft skills, well-known to everyone, yet frequently neglected in practice.
Essential Skills in the Software Testing Field
Here are the most common soft skills for software testing professionals:
Let’s dive deeper into each of these skills to understand their significance and how they contribute to success in the software testing field.
1. Attention to detail :
It is a foundational skill in software testing that contributes to the accuracy, reliability, and overall quality of software products. Testers who possess this skill play a crucial role in ensuring that software meets quality standards, satisfies user requirements, and delivers a positive user experience.
Benefits :
Effective Bug Identification: Testers who pay close attention can find even small issues in the software, helping developers fix them faster.
Ensuring Quality: Attention to detail ensures that all parts of the software meet the required standards by carefully reviewing documents and test cases.
Improving User Experience: Testers focus on making sure the software is easy to use and error-free, which makes users happier and more likely to keep using the product.
Identifying Risks Early: By carefully examining requirements and designs, testers can catch potential problems before they become serious issues, saving time and money.
Building Trust: Thorough testing builds trust in the software among clients and users, showing that it’s reliable and high-quality.
Encouraging Improvement: Testers who pay attention to detail help their teams get better over time by learning from mistakes and finding ways to improve their processes.
2. Proactive communication:
In software testing proactive communication involves initiating and maintaining effective communication within the team and with Developers, Clients, and Stakeholders, throughout the testing process.
Benefits :
Improved Team Collaboration: Proactive communication fosters better collaboration among team members, ensuring everyone is on the same page regarding project goals, tasks, and timelines.
Early Issue Identification: By sharing updates and insights regularly, team members can quickly identify potential issues or roadblocks in the testing process, allowing for timely resolution.
Enhanced Problem-Solving: Proactive communication encourages team members to openly discuss challenges and brainstorm solutions, leading to more effective problem-solving and faster resolution of issues.
Increased Efficiency: Clear and proactive communication helps streamline workflows and eliminate misunderstandings, reducing the likelihood of rework or delays in the testing process.
Effective Task Coordination: By communicating task assignments, dependencies, and priorities proactively, team members can coordinate their efforts more efficiently, ensuring that testing activities progress smoothly.
Boosted Morale: Open and transparent communication creates a positive work environment where team members feel valued and supported, leading to higher morale and job satisfaction.
Continuous Improvement: Proactive communication encourages feedback and discussion about testing processes and practices, enabling the team to identify areas for improvement and implement changes to enhance overall efficiency and effectiveness.
3. Good data organizing and presentation skills :
It involves the ability to effectively structure, format, and present data in a clear, concise, and meaningful manner.
Benefits :
Clarity in Reporting: Testers often need to compile and present data regarding test results, defects, and overall testing progress. Strong data organizing skills ensure that information is presented clearly and concisely, making it easier for clients/stakeholders to understand and interpret.
Effective Communication: Well-organized data facilitates effective communication with developers, project managers, and other stakeholders. Testers can convey testing findings and insights more effectively, leading to quicker decision-making and problem-resolution.
Identifying Patterns and Trends: By organizing data systematically, testers can identify patterns, trends, and correlations in software behavior or defect occurrences. This enables them to make more informed decisions about where to focus testing efforts and how to prioritize issues for resolution.
Facilitating Root Cause Analysis: When defects or issues arise, well-organized data allows testers to conduct thorough root cause analysis. They can trace the origins of problems more efficiently, leading to more accurate diagnoses and more effective solutions.
Enhancing Documentation: Good data organizing skills contribute to the creation of comprehensive and well-structured test documentation. Test plans, test cases, and test reports are more informative and useful when data is organized logically and presented in a clear format.
Demonstrating Value: Effective data presentation showcases the value of testing efforts to stakeholders. By presenting data in a compelling and visually appealing manner, testers can demonstrate the impact of their work on software quality, project success, and overall business objectives.
4. Time management :
In the software testing profession time management involves efficiently allocating and prioritizing time to complete testing tasks, meet deadlines, and ensure the timely delivery of high-quality software. Here are the benefits of effective time management in software testing
Benefits :
Meeting Deadlines: Proper time management allows testers to schedule and prioritize tasks effectively, ensuring that testing activities are completed on time and within project deadlines.
Optimizing Resource Allocation: By managing time efficiently, testers can allocate resources, such as human resources and testing tools, in a way that maximizes productivity and minimizes waste.
Enhancing Testing Coverage: With good time management, testers can allocate sufficient time to different testing activities, including test planning, execution, and defect resolution, ensuring comprehensive testing coverage and thorough validation of the software.
Improving Test Quality: Properly managing time allows testers to dedicate adequate time to each testing activity, reducing the likelihood of rushing through tests or skipping important steps. This results in higher-quality testing outcomes and more reliable software.
Identifying Risks Early: Time management enables testers to allocate time for risk assessment and mitigation activities, such as identifying potential risks, creating contingency plans, and conducting risk-based testing. Early identification of risks helps prevent issues from escalating and ensures smoother project execution.
5. Critical Thinking while Planning Tasks:
It plays a crucial role in planning tasks in the software testing profession.
Benefits :
Identification of Test Objectives: Critical thinking helps testers analyze project requirements and objectives thoroughly, ensuring that testing activities are aligned with the goals of the project. This ensures that testing efforts are focused on verifying the functionality, performance, and quality attributes that are most critical to the project’s success.
Effective Test Strategy Development: Critical thinking enables testers to evaluate different testing approaches and methodologies critically, selecting the most appropriate strategy for the given project context. This ensures that testing efforts are efficient, cost-effective, and capable of uncovering potential defects and issues effectively.
Optimized Test Coverage: Critical thinking allows testers to analyze the software under test critically, identifying key areas and functionalities that require testing priority. By prioritizing testing efforts based on criticality and risk, testers can optimize test coverage and ensure that testing resources are allocated effectively.
Risk Assessment and Mitigation: Critical thinking helps testers assess potential risks and vulnerabilities in the software accurately. By critically analyzing project requirements, dependencies, and constraints, testers can identify and prioritize risks, allowing them to develop targeted risk mitigation strategies and allocate testing resources accordingly.
Identification of Test Scenarios: Critical thinking enables testers to identify and define test scenarios comprehensively. They consider various factors such as user workflows, boundary conditions, error handling, and performance requirements. This ensures that testing coverage is thorough. Critical scenarios are adequately tested as a result.
Adaptability to Changes: Critical thinking equips testers with the ability to adapt and adjust testing plans dynamically. They respond to changing project requirements, priorities, or constraints. Testers critically evaluate the impact of changes on testing objectives and strategies. They make informed decisions and adjust testing plans accordingly. This ensures continued alignment with project goals.
6. Adaptability :
In the software testing profession, adaptability in software testing skills is crucial. Testers need to respond effectively to changes. These changes can include project requirements, priorities, technologies, or constraints.
Benefits :
Flexibility in Test Planning: Testers can adapt their testing strategies and plans to accommodate changes in project scope, timelines, or priorities. This ensures that testing efforts remain aligned with evolving project needs and objectives.
Quick Response to Changes: Adaptability allows testers to respond quickly to changes in software requirements, design, or functionality. They can adjust test cases, test scripts, and test data as needed. This ensures comprehensive coverage of new features or modifications.
Efficient Resource Allocation: Testers can adaptively allocate testing resources, such as persons, tools etc based on changing project demands. This ensures that resources are utilized efficiently and effectively to support testing activities.
Effective Risk Management: Adaptability enables testers to identify and respond proactively to emerging risks or challenges in the testing process. They can adjust testing priorities, focus areas, or methodologies to mitigate risks and ensure they adequately address critical areas.
Enhanced Problem-Solving: Adaptability fosters a problem-solving mindset among testers, enabling them to overcome obstacles or challenges encountered during testing. They can explore alternative approaches, techniques, or tools to address complex testing scenarios effectively.
Continuous Improvement: Adaptability promotes a culture of continuous improvement within testing teams. Testers actively seek feedback, reflect on past experiences, and implement changes to enhance testing processes and practices over time.
Customer Satisfaction: Adaptable testers respond to feedback from end-users or clients. They incorporate preferences or requirements into the testing process. This leads to higher levels of customer satisfaction. It ensures that the software meets user needs effectively.
7. Empathy and customer-centric approach :
In the software testing profession, an empathy and customer-centric approach involves considering the perspective, needs, and experiences of end-users throughout the testing process.
Benefits :
Improved User Satisfaction: Testers can ensure that the software meets users’ needs effectively. This is done by understanding their perspective and requirements. It leads to higher levels of user satisfaction.
Enhanced Usability: Taking an empathetic approach helps testers identify usability issues early in the testing process. This allows for improvements that result in a more user-friendly software interface.
Better Bug Detection: Testers who empathize with users are more likely to anticipate how they will interact with the software. This leads to better identification of potential bugs or defects. These issues could affect user experience.
Enhanced Brand Loyalty: Users develop a sense of loyalty to the brand when they feel that the software understands and addresses their needs. They are more likely to stay committed and engaged. This loyalty often leads to repeat business and positive word-of-mouth referrals.
Alignment with Business Goals: An approach centered around the customer ensures that software testing efforts align with broader business goals. These goals may include increasing revenue, improving market share, or enhancing customer satisfaction.
Conclusion:
In conclusion, software testing skills encompass expertise in various testing methodologies. Technical skills equip you with the knowledge to execute these methodologies effectively. Soft skills complement your efforts by meticulously organizing details in a presentable manner. They also enhance your flexibility and adaptability to navigate dynamic changes in client requirements. This ensures the delivery of a product that meets the end user’s expectations. Therefore, achieving a perfect balance between technical and soft skills is pivotal for recognition and advancement in your career.
Click Here to read more blogs for Software Testing Tips and Practices.
Manisha is a Lead SDET at SpurQLabs with overall experience of 3.5 years in UI Test Automation, Mobile test Automation, Manual testing, database testing, API testing and CI/CD. Proven expertise in creating and maintaining test automation frameworks for Mobile, Web and Rest API in Java, C#, Python and JavaScript.