1. Setup Application – [com.project.setup] folder
1.1 application.properties
1.1.1 Screenshot settings
#Screenshot #Folder contains screenshots. Screenshot is captured when TC getting failed screenshotFolder=C:\\Screenshot #Dropbox access token. Screenshot will be uploaded to Dropbox dropboxAccessToken=gXALZ-x2pGAAAAAAAAAACDvfItRrYwdCVYao53OQ-4cZ8l_dA3JhpVrLfcjpmVkj
To get Dropbox access token
Go to this link and following steps in video as below
1.1.2 Information to send the result via email
#Send result via email # Mail server mailServer=smtp.gmail.com #Username usernameSendEmail=passpulframework@gmail.com #Password passwordSendEmail=password
1.1.3 All database information to be used
#Database information #Data source URL testingDBURL= jdbc:oracle:thin:@host:port/xe #Data source Username testingDBUsername=username #Data source Password testingDBPassword=password
1.1.4 WS information to be used
#Web Service #SOAPUI bin folder soapUIBin=C:\\Program Files\\SmartBear\\SoapUI-5.4.0\\bin #Project file is stored in [com.project.resource.ws] folder sampleSOAPProject=SampleSOAPProject.xml #Test Suite name sampleTestSuite=TestSuite 1 #Test Case name sampleTestCase=TestCase 1 #Folder contains response file responseFolder=D:\\SOAP
1.1.5 File Transfer information to be used
#File Transfer information hostTest=ftp.dlptest.com portTest=22 ftpUsername=username ftpPassword=password
1.1.6 All Credential information to be used
#Credential information adminUsername=username adminPassword=password
1.1.7 All URLs to be used
#URLs homepage=http://passpul.com
1.1.8 All File Paths to be used
#File Path exampleFileTxt=C:\\PassPul\\exampleFile.txt
application.properties full example
#Screenshot #Folder contains screenshots. Screenshot is captured when TC getting failed screenshotFolder=C:\\Screenshot #Dropbox access token. Screenshot will be uploaded to Dropbox dropboxAccessToken=gXALZ-x2pGAAAAAAAAAACDvfItRrYwdCVYao53OQ-4cZ8l_dA3JhpVrLfcjpmVkj #Send result via email #Mail server mailServer=smtp.gmail.com #Username usernameSendEmail=passpul@gmail.com #Password passwordSendEmail=password #Database information #Data source URL testingDBURL= jdbc:oracle:thin:@host:port/xe #Data source Username testingDBUsername=username #Data source Password testingDBPassword=password #Web Service #SOAPUI bin folder soapUIBin=C:\\Program Files\\SmartBear\\SoapUI-5.4.0\\bin #Project file sampleSOAPProject=SampleSOAPProject.xml #Test Suite name sampleTestSuite=TestSuite 1 #Test Case name sampleTestCase=TestCase 1 #Folder contains response file responseFolder=D:\\SOAP #File Transfer information hostTest=ftp.dlptest.com portTest=22 ftpUsername=username ftpPassword=password #Credential information adminUsername=username adminPassword=password #URLs homepage=http://passpul.com #File Path exampleFileTxt=C:\\PassPul\\exampleFile.txt
1.2 Recipient.txt
All people in recipient list will be received an email with the result
admin@passpul.com user1@passpul.com passpul@gmail.com
You have to config something in your Gmail to receive the result
Go to https://myaccount.google.com/lesssecureapps
TURN ON Allow less secure apps
Go to https://mail.google.com/mail/u/0/#settings/general
Select [Conversation view off]
1.3 databaseConnection.properties
Settup database to be used as default
#Data source URL testingDBURL= jdbc:oracle:thin:@host:port/xe #Data source Username testingDBUsername=username #Data source Password testingDBPassword=password
1.4 locator.properties
All loactors to be used
Syntax: LocatorName=Locator_LocatorValue
Locator = XPATH / ID / CSS / CLASSNAME / NAME / LINK / PARTIALLINK
Default is XPATH
saveButton=ID_saveBtn chooseFileButton=XPATH_//*[@id="files"] OR chooseFileButton=//*[@id="files"]
1.5 sqlStatement.properties
All SQL Statements to be used
deleteUser=DELETE FROM user_details WHERE username = 'smith69' getCommentMike28=SELECT COMMENT FROM user_details WHERE username = 'mike28'
2. Design TC – [com.project.resource.testcase] folder
Using PassPul Testcase Template
Column | Description | Example |
---|---|---|
Module | Module description | Homepage |
Sub-module | Sub-module description | Search |
TC_ID | Testcase Number | TC_001 |
Test Scenario | Scenario description | Search result is shown correctly based on inputted keyword |
Priority | The priority of Testcase (High / Medium / Low) | Medium |
Execute | Y / N
Y: Testcase will be executed N: Testcase will be skipped |
Y |
Result | The result will be written after running Testcase (Pass / Fail) | |
Step # | Step number to reproduce | 1 |
Step to Produce | Step description | Input keyword to search |
Keyword | The name of Keyword to be used | SET TEXT |
Keyword Description | Keyword description is updated automatically based on Keyword | Input value into an input field
– Locator(*): Locator of the element to be inputted – Value 1: The text to type in |
Object | The name of element to be interacted | Search button |
Locator | Locator is defined in [locator.properties]
searchBtn= //*[@id=”searchButton”] |
searchBtn |
Value 1 | Based on chosen Keyword
Ex: With keyword [SET TEXT] – Value 1: The text to type in
|
John |
Value 2 | ||
Value 3 | ||
Value 4 | ||
Value 5 | ||
Value 6 | ||
Value 7 | ||
Value 8 | ||
Value 9 | ||
Value 10 | ||
Failure Cause | The failure cause will be written after running Testcase which is failed | |
Screenshot | The link to screenshot when Testcase getting failed |
3. Design Test Suite – TestSuite.xml
All TCs sre stored in [com.project.resource.testcase] folder
WEB
TestSuite.xml | Description |
---|---|
<test name=“TC_Before”>
<classes> <class name=“com.project.execution.PreTestExecution” /> </classes> </test> |
Required settings |
<test name=“TC1”> | Testcase name. This is unique |
<parameter name=“file” value=“TC_001.xlsm” /> | Testcase is stored in [com.project.resource.testcase] folder to be run |
<parameter name=“browser” value=“Chrome” /> | Chrome / Firefox / IE |
<classes>
<class name=“com.project.execution.TestExecution” /> </classes> |
|
</test> | |
<test name=“TC_After”>
<classes> <class name=“com.project.execution.AfterTestExecution” /> </classes> </test> |
Optional – Write Test Summary Report & Send email with attachment result |
TestSuite.xml Example
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Suite"> <!-- Required Settings --> <test name="TC_Before"> <classes> <class name="com.project.execution.PreTestExecution" /> </classes> </test> <!-- All TCs to be run --> <test name="TC1"> <parameter name="file" value="TC_001.xlsm" /> <parameter name="browser" value="Chrome" /> <classes> <class name="com.project.execution.TestExecution" /> </classes> </test> <test name="TC2"> <parameter name="file" value="TC_002.xlsm" /> <parameter name="browser" value="Chrome" /> <classes> <class name="com.project.execution.TestExecution" /> </classes> </test> <!-- Optional – Write Test Summary Report & Send email with attachment result files --> <test name="TC_After"> <classes> <class name="com.project.execution.AfterTestExecution" /> </classes> </test> </suite>
MOBILE
- Run Appium
- Connect real device to your computer. You have to enable USB Debugging Mode on Android
OR use Emulator (Genymotion)
TestSuite.xml | Description |
---|---|
<test name=“TC_Before”>
<classes> <class name=“com.project.execution.PreTestExecution” /> </classes> </test> |
Required settings |
<test name=“TC1”> | Testcase name. This is unique |
<parameter name=“file” value=“TC_Demo_Android_1.xlsm” /> | Testcase is stored in [com.project.resource.testcase] folder to be run |
<parameter name=“platform” value=“Android” /> | Android / IOS platform |
<parameter name=“version” value=“5.1” /> | Android / IOS version |
<parameter name=“deviceName” value=“192.168.60.101:5555” /> | run ‘adb devices’ in the command prompt. |
<parameter name=“app” value=“appdemo.apk” /> | App name is stored in [com.project.resource.apk] folder |
<parameter name=“appPackage” value=“com.appdemo” /> | More details here |
<parameter name=“appActivity” value=” com.appdemo.SplashActivity” /> | |
<parameter name=“url” value=“http://0.0.0.0:4723/wd/hub” /> | Get from Appium host & port |
<classes>
<class name=“com.project.execution.TestExecution_Android” /> </classes> |
|
</test> | |
<test name=“TC_After”>
<classes> <class name=“com.project.execution.AfterTestExecution” /> </classes> </test> |
Optional – Write Test Summary Report & Send email with attachment result |
TestSuite.xml Example
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Suite"> <!-- Required Settings --> <test name="TC_Before"> <classes> <class name="com.project.execution.PreTestExecution" /> </classes> </test> <!-- All TCs to be run --> <test name="TC1"> <parameter name="file" value="TC_Demo_Android_1.xlsm" /> <parameter name="platform" value="Android" /> <parameter name="version" value="5.1" /> <parameter name="deviceName" value="192.168.60.101:5555" /> <parameter name="app" value="appdemo.apk" /> <parameter name="appPackage" value="com.appdemo" /> <parameter name="appActivity" value=" com.appdemo.SplashActivity" /> <parameter name="url" value="http://0.0.0.0:4723/wd/hub" /> <classes> <class name="com.project.execution.TestExecution_Android" /> </classes> </test> <test name="TC2"> <parameter name="file" value="TC_Demo_Android_2.xlsm" /> <parameter name="platform" value="Android" /> <parameter name="version" value="5.1" /> <parameter name="deviceName" value="192.168.60.101:5555" /> <parameter name="app" value="appdemo.apk" /> <parameter name="appPackage" value="com.appdemo" /> <parameter name="appActivity" value=" com.appdemo.SplashActivity" /> <parameter name="url" value="http://0.0.0.0:4723/wd/hub" /> <classes> <class name="com.project.execution.TestExecution_Android" /> </classes> </test> <!-- Optional – Write Test Summary Report & Send email with attachment result files --> <test name="TC_After"> <classes> <class name="com.project.execution.AfterTestExecution" /> </classes> </test> </suite>
4. Run Test Suite
Run Test Suite with TestNG or Jenkins
5. Get the result
The result is stored in [com.project.resource.testcase.result] folder
Or go to email which is cofigured in [Recipient.txt] to get the result