diff --git a/API/Activities/Activity6.xml b/API/Activities/Activity6.xml new file mode 100644 index 0000000000..4e5a436816 --- /dev/null +++ b/API/Activities/Activity6.xml @@ -0,0 +1,25 @@ + +http://ipwhois.appIPTEMPLATEIPIPTEMPLATEIPapplication/json; charset=utf-8200ns:Response<xml-fragment/>http://ipwhois.apphttp://ipwhois.app/json/0.0.0.0No AuthorizationNo AuthorizationIPSEQUENTIAL510COMPIP0falseIPv4falsefalseIPtruefalse<xml-fragment/>http://ipwhois.apphttp://ipwhois.app/json/165.241.79.217200No AuthorizationNo AuthorizationIPcityTransferResponseGETRequest$['city']city_nameData SinkJSONPATHJSONPATHtruelatTransferResponseGETRequest$['latitude']latitudeData SinkJSONPATHJSONPATHtruelongTransferResponseGETRequest$['longitude']longitudeData SinkJSONPATHJSONPATHtruecom.mysql.jdbc.Driverjdbc:mysql://db4free.net:3306/fstm1db?user=fstm1db&password=PASS_VALUE6Y6NowPybqFST Connection( Default environment )INSERT INTO coordinates VALUES(?,?,?);falsecity_nameCenter Pointlatitude33.6456583longitude-86.6836001Data SourceGETRequesttrueFST Connectioncom.mysql.jdbc.Driverjdbc:mysql://db4free.net:3306/fstm1db?user=fstm1db&password=PASS_VALUE6Y6NowPybq// Sample event script to add custom HTTP header to all outgoing REST, SOAP and HTTP(S) calls +// This code is often used for adding custom authentication to ReadyAPI functional tests + +// If hardcoding the token, uncomment and change line 5 +// token = '4567' + +// If your token is parameterized in Project level custom property, uncomment line 8 +// token = request.parent.testCase.testSuite.project.getProperty('auth_token').getValue() + +// To modify all outgoing calls, remove comments from lines 11 to 16 +// headers = request.requestHeaders +// if (headers.containsKey('auth_token2') == false) { +// headers.put('auth_token2', token) +// request.requestHeaders = headers +// }// Save all test step results into files +// Change the directory path in line 5 to a location where you want to store details +// then uncomment lines 5 to 10 + +// filePath = 'C:\\tempOutputDirectory\\' +// fos = new java.io.FileOutputStream(filePath + testStepResult.testStep.label + '.txt', true) +// pw = new java.io.PrintWriter(fos) +// testStepResult.writeTo(pw) +// pw.close() +// fos.close() \ No newline at end of file diff --git a/API/Activities/CalculatorSOAP1.xml b/API/Activities/CalculatorSOAP1.xml new file mode 100644 index 0000000000..b88309e76c --- /dev/null +++ b/API/Activities/CalculatorSOAP1.xml @@ -0,0 +1,800 @@ + + + + + + + + http://www.dneonline.com/calculator.asmx?wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds two integers. This is a test WebService. ©DNE Online + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + http://schemas.xmlsoap.org/wsdl/ + + + + http://www.dneonline.com/calculator.asmx + + + + + + <xml-fragment/> + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + 10\r + 20\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + + + http://www.dneonline.com/calculator.asmx + + + + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + No Authorization + No Authorization + + + + + + + + SEQUENTIAL + + + + + + CalculatorSoap12 + Add + + + <xml-fragment/> + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + 10\r + 10\r + \r + \r +]]> + + + + 200 + + + + + + + + + 507 + + + + + + declare namespace ns1='http://tempuri.org/'; +//ns1:AddResult + 20 + false + false + false + + + + No Authorization + No Authorization + + + + + + + + + + + CalculatorSoap12 + Divide + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + + + + 200 + + + + + + + + 200 + + + + + No Authorization + No Authorization + + + + + + + + + CalculatorSoap12 + Multiply + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + + + + 200 + + + + + + + + 200 + + + + + No Authorization + No Authorization + + + + + + + + + CalculatorSoap12 + Subtract + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + + + + 200 + + + + + + + + 200 + + + + + No Authorization + No Authorization + + + + + + + + + CalculatorSoap + Add + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + + + + 200 + + + + + + + + 200 + + + + + No Authorization + No Authorization + + + + + + + + + CalculatorSoap + Divide + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + + + + 200 + + + + + + + + 200 + + + + + No Authorization + No Authorization + + + + + + + + + CalculatorSoap + Multiply + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + + + + 200 + + + + + + + + 200 + + + + + No Authorization + No Authorization + + + + + + + + + CalculatorSoap + Subtract + + + UTF-8 + http://www.dneonline.com/calculator.asmx + \r + \r + \r + \r + ?\r + ?\r + \r + \r +]]> + + + + + 200 + + + + + + + + 200 + + + + + No Authorization + No Authorization + + + + + + + + + + + + + + + + + + + + + + + // Sample event script to add custom HTTP header to all outgoing REST, SOAP and HTTP(S) calls +// This code is often used for adding custom authentication to ReadyAPI functional tests + +// If hardcoding the token, uncomment and change line 5 +// token = '4567' + +// If your token is parameterized in Project level custom property, uncomment line 8 +// token = request.parent.testCase.testSuite.project.getProperty('auth_token').getValue() + +// To modify all outgoing calls, remove comments from lines 11 to 16 +// headers = request.requestHeaders +// if (headers.containsKey('auth_token2') == false) { +// headers.put('auth_token2', token) +// request.requestHeaders = headers +// } + + + // Save all test step results into files +// Change the directory path in line 5 to a location where you want to store details +// then uncomment lines 5 to 10 + +// filePath = 'C:\\tempOutputDirectory\\' +// fos = new java.io.FileOutputStream(filePath + testStepResult.testStep.label + '.txt', true) +// pw = new java.io.PrintWriter(fos) +// testStepResult.writeTo(pw) +// pw.close() +// fos.close() + + + + diff --git a/API/Activities/DataDrivenTest-External-source.xml b/API/Activities/DataDrivenTest-External-source.xml new file mode 100644 index 0000000000..94c997451d --- /dev/null +++ b/API/Activities/DataDrivenTest-External-source.xml @@ -0,0 +1,25 @@ + +http://ipwhois.appIPIPTEMPLATEIPapplication/json; charset=utf-8200json:Responsehttp://ipwhois.appNo AuthorizationNo AuthorizationIPSEQUENTIALC:/Users/0019TE744/Downloads/FST_API/TextFile.txt,trueCp1252falsetruetrueIPaddresstruefalse<xml-fragment/>http://ipwhois.apphttp://ipwhois.app/json/200$['country']"India"falsefalsefalseNo AuthorizationNo AuthorizationIPDataSourceRequest 1trueC:/Users/0019TE744/Downloads/FST_API/Ips_Excel.xlsxA2falsefalsetruetrueIP Addresstruefalse<xml-fragment/>http://ipwhois.apphttp://ipwhois.app/json/200$['country']"India"falsefalsefalseNo AuthorizationNo AuthorizationIPData SourceRequest 1trueFST_Connectioncom.mysql.jdbc.Driverjdbc:mysql://db4free.net:3306/fstm1db?user=fstm1db&password=PASS_VALUE6Y6NowPybq// Sample event script to add custom HTTP header to all outgoing REST, SOAP and HTTP(S) calls +// This code is often used for adding custom authentication to ReadyAPI functional tests + +// If hardcoding the token, uncomment and change line 5 +// token = '4567' + +// If your token is parameterized in Project level custom property, uncomment line 8 +// token = request.parent.testCase.testSuite.project.getProperty('auth_token').getValue() + +// To modify all outgoing calls, remove comments from lines 11 to 16 +// headers = request.requestHeaders +// if (headers.containsKey('auth_token2') == false) { +// headers.put('auth_token2', token) +// request.requestHeaders = headers +// }// Save all test step results into files +// Change the directory path in line 5 to a location where you want to store details +// then uncomment lines 5 to 10 + +// filePath = 'C:\\tempOutputDirectory\\' +// fos = new java.io.FileOutputStream(filePath + testStepResult.testStep.label + '.txt', true) +// pw = new java.io.PrintWriter(fos) +// testStepResult.writeTo(pw) +// pw.close() +// fos.close() \ No newline at end of file diff --git a/API/Activities/DataDrivenTest_JDBC.xml b/API/Activities/DataDrivenTest_JDBC.xml new file mode 100644 index 0000000000..1b2f391777 --- /dev/null +++ b/API/Activities/DataDrivenTest_JDBC.xml @@ -0,0 +1,498 @@ + + + + + + + + https://petstore.swagger.io + + + + + + + + + application/json + + + + application/json + 400 + + pet:Fault + + + application/json + 200 + + pet:Response + + + + https://petstore.swagger.io + + No Authorization + No Authorization + + + + + + + + + + + + + status + sold + QUERY + sold + + + + + + application/json + 200 + + Response + + + + https://petstore.swagger.io + + No Authorization + No Authorization + + + + + + status + + + + + + + + + + + + petId + petId + TEMPLATE + petId + + + + + + application/json + 404 + + pet:Fault + + + application/json + + + + + 404 + + data + + + application/json + 200 + + pet:Response + + + + https://petstore.swagger.io + + No Authorization + No Authorization + + + + + + petId + + + + + + + + SEQUENTIAL + + + true + true + false + true + true + Multiple Pages + + false + + + + + + + <xml-fragment/> + + + https://petstore.swagger.io + { + "id" : 774290, + "name" : "Pinky", + "status" : "alive" +} + + https://petstore.swagger.io/v2/pet + + + + 200 + + + + { + "id" : 77423, + "name" : "Pinky", + "status" : "alive" +} + + No Authorization + No Authorization + + + + + + + + + + + statusTransfer + Response + POST Request + $[status] + status + GET Request + + JSONPATH + true + + + idTransfer + Response + POST Request + $['id'] + petId + DELETE Request + JSONPATH + true + + + + + + + + + <xml-fragment/> + + https://petstore.swagger.io + { + "id" : 77423, + "name" : "Pinky", + "status" : "alive" +} + + https://petstore.swagger.io/v2/pet/findByStatus + + + + 200 + + + + No Authorization + No Authorization + + + + + + + status + + + + + + + + + + <xml-fragment/> + + https://petstore.swagger.io + + https://petstore.swagger.io/v2/pet/petId + + + + 200 + + + + No Authorization + No Authorization + + + + + + + petId + + + + + + + + + + + + <xml-fragment/> + + + + + com.mysql.jdbc.Driver + jdbc:mysql://db4free.net:3306/fstm1db?user=fstm1db&password=PASS_VALUE + 6Y6NowPybq + FST_Coonection( Default environment ) + SELECT * FROM petData; + + false + + + true + true + petId + petName + petStatus + true + true + false + + + + + + + + <xml-fragment/> + + + https://petstore.swagger.io + { + "id" : ${DataSource#petId}, + "name" : "${DataSource#petName}", + "status" : "${DataSource#petStatus}" + } + + https://petstore.swagger.io/v2/pet + + + + 200 + + + + { + "id" : 77423, + "name" : "Pinky", + "status" : "alive" +} + + No Authorization + No Authorization + + + + + + + + + + + statusTanfer + Response + POST Request + $[status] + status + GET Request + JSONPATH + true + + + idTransfer + Response + POST Request + $['id'] + petId + DELETE Request + JSONPATH + true + + + + + + + + + <xml-fragment/> + + https://petstore.swagger.io + { + "id" : 77423, + "name" : "Pinky", + "status" : "alive" +} + + https://petstore.swagger.io/v2/pet/findByStatus + + + + 200 + + + + No Authorization + No Authorization + + + + + + + status + + + + + + + + + + <xml-fragment/> + + https://petstore.swagger.io + + https://petstore.swagger.io/v2/pet/petId + + + + 200 + + + + No Authorization + No Authorization + + + + + + + petId + + + + + + + + Data Source + POST Request + true + + + + + + + + + + + + + + FST_Coonection + com.mysql.jdbc.Driver + jdbc:mysql://db4free.net:3306/fstm1db?user=fstm1db&password=PASS_VALUE + 6Y6NowPybq + + + + + + + + + + + + // Sample event script to add custom HTTP header to all outgoing REST, SOAP and HTTP(S) calls +// This code is often used for adding custom authentication to ReadyAPI functional tests + +// If hardcoding the token, uncomment and change line 5 +// token = '4567' + +// If your token is parameterized in Project level custom property, uncomment line 8 +// token = request.parent.testCase.testSuite.project.getProperty('auth_token').getValue() + +// To modify all outgoing calls, remove comments from lines 11 to 16 +// headers = request.requestHeaders +// if (headers.containsKey('auth_token2') == false) { +// headers.put('auth_token2', token) +// request.requestHeaders = headers +// } + + + // Save all test step results into files +// Change the directory path in line 5 to a location where you want to store details +// then uncomment lines 5 to 10 + +// filePath = 'C:\\tempOutputDirectory\\' +// fos = new java.io.FileOutputStream(filePath + testStepResult.testStep.label + '.txt', true) +// pw = new java.io.PrintWriter(fos) +// testStepResult.writeTo(pw) +// pw.close() +// fos.close() + + + + diff --git a/API/Activities/GitHub-Project-readyapi-project.xml b/API/Activities/GitHub-Project-readyapi-project.xml new file mode 100644 index 0000000000..91b70910b5 --- /dev/null +++ b/API/Activities/GitHub-Project-readyapi-project.xml @@ -0,0 +1,331 @@ + + + + + + + + https://api.github.com + + + + + + + + + application/json; charset=utf-8 + 201 + + keys:Response + + + application/json + + + + application/json; charset=utf-8 + 422 + + keys:Fault + + + + https://api.github.com + + + + + + + + + + + + keyId + keyId + TEMPLATE + keyId + + + + + + application/json; charset=utf-8 + 401 + + key:Fault + + + application/json; charset=utf-8 + 200 + + key:Response + + + + https://api.github.com + + + + + keyId + + + + + + + + keyId + keyId + TEMPLATE + keyId + + + + + + application/json; charset=utf-8 + 401 + + key:Fault + + + application/json + + + + + 204 + + data + + + + https://api.github.com + + + + + keyId + + + + + + + + SEQUENTIAL + + + + + + + + <xml-fragment/> + + https://api.github.com + { + "title":"TestKey", + "key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCpFBBBV0psYemNbuj17GHCBwIDl3i4pNS7pYWMDsLUGjZmTV8MzeAI+bopF4yRuZBlNIWdIr2nqtWu+RQ5MLcTQ+warNucxCzJYdOyN2xnsIkdCDa9iaUn3kXKrD+vbFrPaWzTyKXVNxn7FqahK4FQGX2lCtv8qJZJJt9mjWy+fQ==" + + https://api.github.com/user/keys + + + + 201 + + + + + $['key'] + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCpFBBBV0psYemNbuj17GHCBwIDl3i4pNS7pYWMDsLUGjZmTV8MzeAI+bopF4yRuZBlNIWdIr2nqtWu+RQ5MLcTQ+warNucxCzJYdOyN2xnsIkdCDa9iaUn3kXKrD+vbFrPaWzTyKXVNxn7FqahK4FQGX2lCtv8qJZJJt9mjWy+fQ== + false + false + false + + + + GitHubProject + No Authorization + + + + + + + + + + + tranferId + Response + POST Request + $['id'] + keyId + GET Request + + JSONPATH + JSONPATH + true + + + delid + Response + POST Request + $['id'] + keyId + DELETE Request + JSONPATH + JSONPATH + true + + + + + + + + + <xml-fragment/> + + https://api.github.com + + https://api.github.com/user/keys/keyId + + + + 200 + + + + + $['key'] + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCpFBBBV0psYemNbuj17GHCBwIDl3i4pNS7pYWMDsLUGjZmTV8MzeAI+bopF4yRuZBlNIWdIr2nqtWu+RQ5MLcTQ+warNucxCzJYdOyN2xnsIkdCDa9iaUn3kXKrD+vbFrPaWzTyKXVNxn7FqahK4FQGX2lCtv8qJZJJt9mjWy+fQ== + false + false + false + + + + GitHubProject + No Authorization + + + + + + + keyId + + + + + + + + + + <xml-fragment/> + + https://api.github.com + + https://api.github.com/user/keys/keyId + + + + 204 + + + + GitHubProject + No Authorization + + + + + + + keyId + + + + + + + + + + + + + + + + + + GitHubProject + OAuth 2.0 + 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 + HEADER + ENTERED_MANUALLY + ENTERED_MANUALLY + AUTHORIZATION_CODE_GRANT + AUTOMATIC + + id_token + + + + + + + + + // Sample event script to add custom HTTP header to all outgoing REST, SOAP and HTTP(S) calls +// This code is often used for adding custom authentication to ReadyAPI functional tests + +// If hardcoding the token, uncomment and change line 5 +// token = '4567' + +// If your token is parameterized in Project level custom property, uncomment line 8 +// token = request.parent.testCase.testSuite.project.getProperty('auth_token').getValue() + +// To modify all outgoing calls, remove comments from lines 11 to 16 +// headers = request.requestHeaders +// if (headers.containsKey('auth_token2') == false) { +// headers.put('auth_token2', token) +// request.requestHeaders = headers +// } + + + // Save all test step results into files +// Change the directory path in line 5 to a location where you want to store details +// then uncomment lines 5 to 10 + +// filePath = 'C:\\tempOutputDirectory\\' +// fos = new java.io.FileOutputStream(filePath + testStepResult.testStep.label + '.txt', true) +// pw = new java.io.PrintWriter(fos) +// testStepResult.writeTo(pw) +// pw.close() +// fos.close() + + + + GitHubProject + OAuth 2.0 + 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 + HEADER + ENTERED_MANUALLY + ENTERED_MANUALLY + AUTHORIZATION_CODE_GRANT + AUTOMATIC + + id_token + + + + diff --git a/API/Activities/PetStoreRest.xml b/API/Activities/PetStoreRest.xml new file mode 100644 index 0000000000..9d38c8e497 --- /dev/null +++ b/API/Activities/PetStoreRest.xml @@ -0,0 +1,33 @@ + +https://petstore.swagger.ioapplication/jsonapplication/json200pet:Responsehttps://petstore.swagger.ioNo AuthorizationNo AuthorizationstatussoldQUERYsoldapplication/json200Responsehttps://petstore.swagger.ioNo AuthorizationNo AuthorizationstatuspetIdpetIdTEMPLATEpetIdapplication/jsonapplication/json200ns:Response404datahttps://petstore.swagger.ioNo AuthorizationNo AuthorizationpetIdSEQUENTIAL<xml-fragment/>https://petstore.swagger.io{ + "id": 42000, + "name": "CharmLucky", + "status": "alive" +}https://petstore.swagger.io/v2/pet200$['status']alivefalsefalsefalseNo AuthorizationNo AuthorizationstatusTransferResponsePost Request$['status']statusGet RequestJSONPATHJSONPATHtrueidTransferResponsePost Request$['id']petIdDelete requestJSONPATHtrue<xml-fragment/>https://petstore.swagger.iohttps://petstore.swagger.io/v2/pet/findByStatus200No AuthorizationNo Authorizationstatus<xml-fragment/>https://petstore.swagger.iohttps://petstore.swagger.io/v2/pet/4200200$['message']${Delete request#petId}falsefalsefalseNo AuthorizationNo AuthorizationpetIdc5b3df29-4587-4042-bc9b-6cfa755f651cNONEadb8074e-ee7e-4415-ab0f-8a1aafb44289NONE071f3aea-935a-4468-be64-87a3101c05d1NONEf841f5b0-ac47-4f8d-82b1-e0ac55bfff68NONEtruetruefalsetruetruetruetruetrue]]>20250Scoobyalive]]>20260Rubyalive]]>20270Hobbyalive]]>truetruetruepetIDpetNamepetStatustruetruefalse<xml-fragment/>https://petstore.swagger.io{ + "id": ${DataSource#petID}, + "name": "${DataSource#petName}", + "status": "${DataSource#petStatus}" +}https://petstore.swagger.io/v2/pet200$['status']alivefalsefalsefalseNo AuthorizationNo AuthorizationstatusTransferResponsePost Request$['status']statusGet RequestJSONPATHJSONPATHtrueidTransferResponsePost Request$['id']petIdDelete requestJSONPATHtrue<xml-fragment/>https://petstore.swagger.iohttps://petstore.swagger.io/v2/pet/findByStatus200No AuthorizationNo Authorizationstatus<xml-fragment/>https://petstore.swagger.iohttps://petstore.swagger.io/v2/pet/4200200$['message']${Delete request#petId}falsefalsefalseNo AuthorizationNo AuthorizationpetIdDataSourcePost RequestfalseC:/Users/0019TE744/Downloads/FST_API/New Microsoft Excel Worksheet.xlsxSheet1A1truefalseid${DataSource#petID}namestatusc5b3df29-4587-4042-bc9b-6cfa755f651cNONEadb8074e-ee7e-4415-ab0f-8a1aafb44289NONE071f3aea-935a-4468-be64-87a3101c05d1NONEf841f5b0-ac47-4f8d-82b1-e0ac55bfff68NONE// Sample event script to add custom HTTP header to all outgoing REST, SOAP and HTTP(S) calls +// This code is often used for adding custom authentication to ReadyAPI functional tests + +// If hardcoding the token, uncomment and change line 5 +// token = '4567' + +// If your token is parameterized in Project level custom property, uncomment line 8 +// token = request.parent.testCase.testSuite.project.getProperty('auth_token').getValue() + +// To modify all outgoing calls, remove comments from lines 11 to 16 +// headers = request.requestHeaders +// if (headers.containsKey('auth_token2') == false) { +// headers.put('auth_token2', token) +// request.requestHeaders = headers +// }// Save all test step results into files +// Change the directory path in line 5 to a location where you want to store details +// then uncomment lines 5 to 10 + +// filePath = 'C:\\tempOutputDirectory\\' +// fos = new java.io.FileOutputStream(filePath + testStepResult.testStep.label + '.txt', true) +// pw = new java.io.PrintWriter(fos) +// testStepResult.writeTo(pw) +// pw.close() +// fos.close() \ No newline at end of file diff --git a/API/Project/GitHub-Project-readyapi-project (1).xml b/API/Project/GitHub-Project-readyapi-project (1).xml new file mode 100644 index 0000000000..91b70910b5 --- /dev/null +++ b/API/Project/GitHub-Project-readyapi-project (1).xml @@ -0,0 +1,331 @@ + + + + + + + + https://api.github.com + + + + + + + + + application/json; charset=utf-8 + 201 + + keys:Response + + + application/json + + + + application/json; charset=utf-8 + 422 + + keys:Fault + + + + https://api.github.com + + + + + + + + + + + + keyId + keyId + TEMPLATE + keyId + + + + + + application/json; charset=utf-8 + 401 + + key:Fault + + + application/json; charset=utf-8 + 200 + + key:Response + + + + https://api.github.com + + + + + keyId + + + + + + + + keyId + keyId + TEMPLATE + keyId + + + + + + application/json; charset=utf-8 + 401 + + key:Fault + + + application/json + + + + + 204 + + data + + + + https://api.github.com + + + + + keyId + + + + + + + + SEQUENTIAL + + + + + + + + <xml-fragment/> + + https://api.github.com + { + "title":"TestKey", + "key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCpFBBBV0psYemNbuj17GHCBwIDl3i4pNS7pYWMDsLUGjZmTV8MzeAI+bopF4yRuZBlNIWdIr2nqtWu+RQ5MLcTQ+warNucxCzJYdOyN2xnsIkdCDa9iaUn3kXKrD+vbFrPaWzTyKXVNxn7FqahK4FQGX2lCtv8qJZJJt9mjWy+fQ==" + + https://api.github.com/user/keys + + + + 201 + + + + + $['key'] + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCpFBBBV0psYemNbuj17GHCBwIDl3i4pNS7pYWMDsLUGjZmTV8MzeAI+bopF4yRuZBlNIWdIr2nqtWu+RQ5MLcTQ+warNucxCzJYdOyN2xnsIkdCDa9iaUn3kXKrD+vbFrPaWzTyKXVNxn7FqahK4FQGX2lCtv8qJZJJt9mjWy+fQ== + false + false + false + + + + GitHubProject + No Authorization + + + + + + + + + + + tranferId + Response + POST Request + $['id'] + keyId + GET Request + + JSONPATH + JSONPATH + true + + + delid + Response + POST Request + $['id'] + keyId + DELETE Request + JSONPATH + JSONPATH + true + + + + + + + + + <xml-fragment/> + + https://api.github.com + + https://api.github.com/user/keys/keyId + + + + 200 + + + + + $['key'] + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCpFBBBV0psYemNbuj17GHCBwIDl3i4pNS7pYWMDsLUGjZmTV8MzeAI+bopF4yRuZBlNIWdIr2nqtWu+RQ5MLcTQ+warNucxCzJYdOyN2xnsIkdCDa9iaUn3kXKrD+vbFrPaWzTyKXVNxn7FqahK4FQGX2lCtv8qJZJJt9mjWy+fQ== + false + false + false + + + + GitHubProject + No Authorization + + + + + + + keyId + + + + + + + + + + <xml-fragment/> + + https://api.github.com + + https://api.github.com/user/keys/keyId + + + + 204 + + + + GitHubProject + No Authorization + + + + + + + keyId + + + + + + + + + + + + + + + + + + GitHubProject + OAuth 2.0 + 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 + HEADER + ENTERED_MANUALLY + ENTERED_MANUALLY + AUTHORIZATION_CODE_GRANT + AUTOMATIC + + id_token + + + + + + + + + // Sample event script to add custom HTTP header to all outgoing REST, SOAP and HTTP(S) calls +// This code is often used for adding custom authentication to ReadyAPI functional tests + +// If hardcoding the token, uncomment and change line 5 +// token = '4567' + +// If your token is parameterized in Project level custom property, uncomment line 8 +// token = request.parent.testCase.testSuite.project.getProperty('auth_token').getValue() + +// To modify all outgoing calls, remove comments from lines 11 to 16 +// headers = request.requestHeaders +// if (headers.containsKey('auth_token2') == false) { +// headers.put('auth_token2', token) +// request.requestHeaders = headers +// } + + + // Save all test step results into files +// Change the directory path in line 5 to a location where you want to store details +// then uncomment lines 5 to 10 + +// filePath = 'C:\\tempOutputDirectory\\' +// fos = new java.io.FileOutputStream(filePath + testStepResult.testStep.label + '.txt', true) +// pw = new java.io.PrintWriter(fos) +// testStepResult.writeTo(pw) +// pw.close() +// fos.close() + + + + GitHubProject + OAuth 2.0 + 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 + HEADER + ENTERED_MANUALLY + ENTERED_MANUALLY + AUTHORIZATION_CODE_GRANT + AUTOMATIC + + id_token + + + + diff --git a/API/Project/GitHubProjectReport.xls b/API/Project/GitHubProjectReport.xls new file mode 100644 index 0000000000..151d36a3d3 Binary files /dev/null and b/API/Project/GitHubProjectReport.xls differ diff --git a/Appium/Activities/Activity5.java b/Appium/Activities/Activity5.java new file mode 100644 index 0000000000..29d24cec43 --- /dev/null +++ b/Appium/Activities/Activity5.java @@ -0,0 +1,77 @@ +package activities; +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; + +import io.appium.java_client.android.nativekey.AndroidKey; +import io.appium.java_client.android.nativekey.KeyEvent; + +public class Activity5 { + // Driver Declaration + AndroidDriver driver; + WebDriverWait wait; + + // Set up method + @BeforeClass + public void setUp() throws MalformedURLException { + // Desired Capabilities + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.google.android.apps.messaging"); + options.setAppActivity(".ui.ConversationListActivity"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + } + + // Test method + @Test + public void smsTest() { + // Find and click the add button + driver.findElement(AppiumBy.accessibilityId("Start new conversation")).click(); + + // Wait for elements to load + wait.until(ExpectedConditions.elementToBeClickable( + AppiumBy.id("recipient_text_view") + )); + + // Find the element to add recipient + driver.findElement(AppiumBy.id("recipient_text_view")).sendKeys("18282832912"); + // Press ENTER + driver.pressKey(new KeyEvent(AndroidKey.ENTER)); + + // Wait for textbox to appear + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.id("compose_message_text"))); + + // Enter text to send + driver.findElement(AppiumBy.id("compose_message_text")).sendKeys("Hello from Appium"); + // Press Send + driver.findElement(AppiumBy.accessibilityId("Send SMS")).click(); + + // Assertion + String messageTextSent = driver.findElement(AppiumBy.id("message_text")).getText(); + Assert.assertEquals(messageTextSent, "Hello from Appium"); + } + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Activities/Activity6.java b/Appium/Activities/Activity6.java new file mode 100644 index 0000000000..d329af0606 --- /dev/null +++ b/Appium/Activities/Activity6.java @@ -0,0 +1,80 @@ + +package activities; +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; +import java.util.List; + + +public class Activity6 { + // Driver Declaration + AndroidDriver driver; + WebDriverWait wait; + + // Set up method + @BeforeClass + public void setUp() throws MalformedURLException { + // Desired Capabilities + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.android.chrome"); + options.setAppActivity("com.google.android.apps.chrome.Main"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + + // Open the page in Chrome + driver.get("https://v1.training-support.net/selenium/lazy-loading"); + } + + // Test method + @Test + public void chromeTest() { + String UiScrollable = "UiScrollable(UiSelector().scrollable(true))"; + + // Wait for page to load + wait.until(ExpectedConditions.visibilityOfElementLocated(AppiumBy.className("android.widget.Image"))); + + // Find all the image elements on the page + List imageElements = driver.findElements(AppiumBy.className("android.widget.Image")); + + // Print the number of images + System.out.println("Before scroll: " + imageElements.size()); + + // Scroll using UiScrollable + driver.findElement(AppiumBy.androidUIAutomator(UiScrollable + ".scrollTextIntoView(\"helen\")")); + + // Get image elements after scroll + imageElements = driver.findElements(AppiumBy.className("android.widget.Image")); + + // Print the number of images after scroll + System.out.println("After scroll: " + imageElements.size()); + + // Assertions + Assert.assertEquals(imageElements.size(), 5); + } + + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Activities/Activity7.java b/Appium/Activities/Activity7.java new file mode 100644 index 0000000000..6828e5f6a0 --- /dev/null +++ b/Appium/Activities/Activity7.java @@ -0,0 +1,59 @@ +package activities; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; +import java.util.List; + +public class Activity7 { + + AndroidDriver driver; + WebDriverWait wait; + + @BeforeClass + public void SetUp() throws MalformedURLException { + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("Android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.android.chrome"); + options.setAppActivity("com.google.android.apps.chrome.Main"); + options.noReset(); + + URL serverURL = new URL("http://localhost:4723/wd/hub"); + + driver = new AndroidDriver(serverURL, options); + + driver.get("https://v1.training-support.net/selenium/lazy-loading"); + wait = new WebDriverWait(driver, Duration.ofSeconds(30)); + } + + @Test + public void webAppTest() throws InterruptedException { + wait.until(ExpectedConditions.presenceOfElementLocated(AppiumBy.xpath("//android.widget.TextView[@text=\"Lazy Loading\"]"))); + + String UiScrollable = "UiScrollable(UiSelector().scrollable(true))"; + + driver.findElement(AppiumBy.androidUIAutomator(UiScrollable + ".scrollForward().getChildByText(className(\"android.widget.Image\"), \"helen\")")); + List imagesAfterScroll = driver.findElements(AppiumBy.xpath("//android.widget.Image")); + + Assert.assertEquals(imagesAfterScroll.size(), 2); + } + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Activities/Activity8.java b/Appium/Activities/Activity8.java new file mode 100644 index 0000000000..8890412cae --- /dev/null +++ b/Appium/Activities/Activity8.java @@ -0,0 +1,76 @@ + +package activities; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.Point; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; +import java.util.List; + +public class Activity8 { + + AndroidDriver driver; + WebDriverWait wait; + + @BeforeClass + public void SetUp() throws MalformedURLException { + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("Android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.android.chrome"); + options.setAppActivity("com.google.android.apps.chrome.Main"); + options.noReset(); + + URL serverURL = new URL("http://localhost:4723/wd/hub"); + + driver = new AndroidDriver(serverURL, options); + wait = new WebDriverWait(driver, Duration.ofSeconds(30)); + + driver.get("https://v1.training-support.net/selenium"); + } + + @Test + public void todoListTest() { + Dimension dims = driver.manage().window().getSize(); + Point start = new Point((int)(dims.getWidth() * 0.5), (int)(dims.getHeight() * 0.8)); + Point end = new Point((int)(dims.getWidth() * 0.5), (int)(dims.getHeight() * 0.6)); + + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.xpath("//android.widget.Button[@text=\"Get Started!\"]"))).click(); + + ActionsBase.doSwipe(driver, start, end, 50); + + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.xpath("//android.widget.TextView[@text=\"To-Do List\"]"))).click(); + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.xpath("//android.widget.TextView[@text=\"To-Do List\"]"))); + + int sizeBeforeTask = driver.findElements(AppiumBy.xpath("//android.widget.TextView")).size(); + driver.findElement(AppiumBy.xpath("//android.webkit.WebView[@text=\"Todo List\"]/android.view.View/android.view.View/android.view.View[1]/android.widget.EditText")).sendKeys("Add tasks to list"); + driver.findElement(AppiumBy.xpath("//android.widget.Button[@text=\"Add Task\"]")).click(); + driver.findElement(AppiumBy.xpath("//android.webkit.WebView[@text=\"Todo List\"]/android.view.View/android.view.View/android.view.View[1]/android.widget.EditText")).sendKeys("Get number of tasks"); + driver.findElement(AppiumBy.xpath("//android.widget.Button[@text=\"Add Task\"]")).click(); + driver.findElement(AppiumBy.xpath("//android.webkit.WebView[@text=\"Todo List\"]/android.view.View/android.view.View/android.view.View[1]/android.widget.EditText")).sendKeys("Clear the list"); + driver.findElement(AppiumBy.xpath("//android.widget.Button[@text=\"Add Task\"]")).click(); + + //Number of task + List tasks = driver.findElements(AppiumBy.xpath("//android.widget.TextView")); + Assert.assertEquals(tasks.size(), sizeBeforeTask+3); + + //Strike + driver.findElement(AppiumBy.xpath("//android.widget.TextView[@text=\"Add tasks to list\"]")).click(); + driver.findElement(AppiumBy.xpath("//android.widget.TextView[@text=\"Get number of tasks\"]")).click(); + driver.findElement(AppiumBy.xpath("//android.widget.TextView[@text=\"Clear the list\"]")).click(); + + //Clear + driver.findElement(AppiumBy.xpath("//android.webkit.WebView[@text=\"Todo List\"]/android.view.View/android.view.View/android.view.View[3]")).click(); + } +} diff --git a/Appium/Activities/Activityy1.java b/Appium/Activities/Activityy1.java new file mode 100644 index 0000000000..2f8f9f4828 --- /dev/null +++ b/Appium/Activities/Activityy1.java @@ -0,0 +1,60 @@ +package Examples; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; + +public class Activity1 +{ + // Driver Declaration + AndroidDriver driver; + + // Setting up + @BeforeClass + public void setUp() throws MalformedURLException { + + + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.google.android.calculator"); + options.setAppActivity("com.android.calculator2.Calculator"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + } + + // Test method + @Test + public void multiplyTest() { + // Perform the calculation + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/op_mul")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_4")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/eq")).click(); + + + String product = driver.findElement(AppiumBy.id("result_final")).getText(); + + // Assertion + Assert.assertEquals(product, "20"); + } + + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Activities/Activityy2.java b/Appium/Activities/Activityy2.java new file mode 100644 index 0000000000..0e57f2fa17 --- /dev/null +++ b/Appium/Activities/Activityy2.java @@ -0,0 +1,68 @@ +package Examples; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; + +public class Activity2 +{ + // Driver Declaration + AndroidDriver driver; + + // Set up method + @BeforeClass + public void setUp() throws MalformedURLException { + // Desired Capabilities + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.android.chrome"); + options.setAppActivity("com.google.android.apps.chrome.Main"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + + // Open the page in Chrome + driver.get("https://www.training-support.net"); + } + + // Test method + @Test + public void chromeTest() { + // Find heading on the page + String pageHeading = driver.findElement(AppiumBy.xpath( + "//android.view.View[@text='Training Support']" + )).getText(); + + // Print to console + System.out.println("Heading: " + pageHeading); + + // Find and click the About Us link + driver.findElement(AppiumBy.xpath("//android.view.View[@resource-id='about-link']" + )).click(); + + // Find heading of new page and print to console + String aboutPageHeading = driver.findElement(AppiumBy.xpath( + "//android.view.View[@text='About Us']" + )).getText(); + System.out.println(aboutPageHeading); + } + + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Activities/Activityy3.java b/Appium/Activities/Activityy3.java new file mode 100644 index 0000000000..7b9130304e --- /dev/null +++ b/Appium/Activities/Activityy3.java @@ -0,0 +1,102 @@ +package Examples; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; + + + +public class Activity3 +{ + // Driver Declaration + AndroidDriver driver; + + // Setting up + @BeforeClass + public void setUp() throws MalformedURLException { + + + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.google.android.calculator"); + options.setAppActivity("com.android.calculator2.Calculator"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + } + + // Test method + @Test + public void calcuations() { + // Perform the summation + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/op_add")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_9")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/eq")).click(); + String sum = driver.findElement(AppiumBy.id("result_final")).getText(); + + // Printing and Assertion + System.out.println("Sum of 5 and 9 is "+ sum); + Assert.assertEquals(sum, "14"); + + //Subtraction + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_1")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/op_sub")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/eq")).click(); + String balance = driver.findElement(AppiumBy.id("result_final")).getText(); + + //Printing and Assertion + System.out.println("When 5 is deducted from 10, you will get "+ balance); + Assert.assertEquals(balance, "5"); + + //Multiplication + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/op_mul")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_1")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/eq")).click(); + String product = driver.findElement(AppiumBy.id("result_final")).getText(); + + //Printing and Assertion + System.out.println("Product of 5 and 100 "+ product); + Assert.assertEquals(product, "500"); + + //Division + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.accessibilityId("divide")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_2")).click(); + String divResult = driver.findElement(AppiumBy.id("com.google.android.calculator:id/result_preview")).getText(); + + //Printing and Assertion + System.out.println("Result if 50/2 is "+ divResult); + Assert.assertEquals(divResult, "25"); + + } + + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Activities/Activityy4.java b/Appium/Activities/Activityy4.java new file mode 100644 index 0000000000..7b82bcfd31 --- /dev/null +++ b/Appium/Activities/Activityy4.java @@ -0,0 +1,81 @@ +package Examples; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; + + +public class Activity4 +{ + // Driver Declaration + AndroidDriver driver; + WebDriverWait wait; + + // Set up method + @BeforeClass + public void setUp() throws MalformedURLException { + // Desired Capabilities + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.google.android.contacts"); + options.setAppActivity("com.google.android.apps.contacts.editor.ContactEditorActivity"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + } + + // Test method + @Test + public void contactsTest() { + // Find and click the add button + driver.findElement(AppiumBy.accessibilityId("Contacts")).click(); + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.id("com.google.android.contacts:id/floating_action_button"))); + driver.findElement(AppiumBy.id("com.google.android.contacts:id/floating_action_button")).click(); + // Wait for elements to load + wait.until(ExpectedConditions.elementToBeClickable( + AppiumBy.xpath("//android.widget.EditText[@text=\"First name\"]") + )); + + // Enter the details + driver.findElement(AppiumBy.xpath( + "//android.widget.EditText[@text=\"First name\"]" + )).sendKeys("Sreevara"); + driver.findElement(AppiumBy.xpath( + "//android.widget.EditText[@text=\"Last name\"]" + )).sendKeys("Mysore"); + driver.findElement(AppiumBy.xpath( + "//android.widget.EditText[@text=\"Phone\"]" + )).sendKeys("9448488175"); + // Click Save + driver.findElement(AppiumBy.id("com.google.android.contacts:id/toolbar_button")).click(); + + // Wait for contact to save + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.id("com.google.android.contacts:id/large_title"))); + + // Assertion + String contactName = driver.findElement(AppiumBy.id("com.google.android.contacts:id/large_title")).getText(); + Assert.assertEquals(contactName, "Sreevara Mysore"); + } + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Project/Activity2.java b/Appium/Project/Activity2.java new file mode 100644 index 0000000000..ac8fadefdf --- /dev/null +++ b/Appium/Project/Activity2.java @@ -0,0 +1,68 @@ +package Appium_Project; + +import com.beust.ah.A; +import io.appium.java_client.AppiumBy; +import io.appium.java_client.TouchAction; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import io.appium.java_client.ios.IOSTouchAction; +import io.appium.java_client.touch.offset.PointOption; +import io.opentelemetry.api.baggage.propagation.W3CBaggagePropagator; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.Point; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; + + +public class Activity2 +{ + // Driver Declaration + AndroidDriver driver; + + // Setting up + @BeforeClass + public void setUp() throws MalformedURLException + { + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + + } + + @Test + public void addGoogleTasks() throws InterruptedException { + + //Adding tasks + driver.findElement(AppiumBy.accessibilityId("Tasks")).click(); + Thread.sleep(500); + driver.findElement(AppiumBy.accessibilityId("Create new task")).click(); + driver.findElement(AppiumBy.id("com.google.android.apps.tasks:id/add_task_title")).sendKeys("Complete Activity with Google Tasks"); + driver.findElement(AppiumBy.id("com.google.android.apps.tasks:id/add_task_done")).click(); + Thread.sleep(300); + driver.findElement(AppiumBy.accessibilityId("Create new task")).click(); + driver.findElement(AppiumBy.id("com.google.android.apps.tasks:id/add_task_title")).sendKeys("Complete Activity with Google Keep"); + driver.findElement(AppiumBy.id("com.google.android.apps.tasks:id/add_task_done")).click(); + Thread.sleep(300); + driver.findElement(AppiumBy.accessibilityId("Create new task")).click(); + driver.findElement(AppiumBy.id("com.google.android.apps.tasks:id/add_task_title")).sendKeys("Complete the second Activity Google Keep"); + driver.findElement(AppiumBy.id("com.google.android.apps.tasks:id/add_task_done")).click(); + + //Assetions + String taskDesc = driver.findElement(AppiumBy.xpath("//android.widget.TextView[@resource-id=\"com.google.android.apps.tasks:id/task_name\" and @text=\"Complete the second Activity Google Keep\"]")).getText(); + Assert.assertEquals(taskDesc,"Complete the second Activity Google Keep"); + taskDesc = driver.findElement(AppiumBy.xpath("//android.widget.TextView[@resource-id=\"com.google.android.apps.tasks:id/task_name\" and @text=\"Complete Activity with Google Keep\"]")).getText(); + Assert.assertEquals(taskDesc, "Complete Activity with Google Keep"); + taskDesc = driver.findElement(AppiumBy.xpath("//android.widget.TextView[@resource-id=\"com.google.android.apps.tasks:id/task_name\" and @text=\"Complete Activity with Google Tasks\"]")).getText(); + Assert.assertEquals(taskDesc, "Complete Activity with Google Tasks"); + } +} diff --git a/Appium/Project/Activity5.java b/Appium/Project/Activity5.java new file mode 100644 index 0000000000..2538ed54b7 --- /dev/null +++ b/Appium/Project/Activity5.java @@ -0,0 +1,62 @@ +package Appium_Project; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import io.appium.java_client.TouchAction; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.touch.offset.PointOption; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; + + +public class Activity5 +{ + AndroidDriver driver; + WebDriverWait wait; + + // Set up method + @BeforeClass + public void setUp() throws MalformedURLException { + // Desired Capabilities + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.android.chrome"); + options.setAppActivity("com.google.android.apps.chrome.Main"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + wait = new WebDriverWait(driver, Duration.ofSeconds(30)); + + // Open the page in Chrome + driver.get("https://v1.training-support.net/selenium"); + } + @Test + public void login() throws InterruptedException + { + String UiScrollable = "UiScrollable(UiSelector().scrollable(true))"; + wait.until(ExpectedConditions.presenceOfElementLocated(AppiumBy.xpath("//android.view.View"))); + driver.findElement(AppiumBy.androidUIAutomator(UiScrollable + ".flingForward()")); + + Thread.sleep(1000); + //driver.findElement(AppiumBy.xpath("//android.widget.TextView[@text=\"To-Do List\"]")).click(); + driver.findElement(AppiumBy.xpath("")).click(); + + //Login Form  Please sign in. + + } + +} diff --git a/Appium/Project/Activity6.java b/Appium/Project/Activity6.java new file mode 100644 index 0000000000..d83b17e64a --- /dev/null +++ b/Appium/Project/Activity6.java @@ -0,0 +1,60 @@ +package Project; +import Activities.ActionsBase; +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.Point; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; + +public class Activity6 { + + AndroidDriver driver; + WebDriverWait wait; + + @BeforeClass + public void SetUp() throws MalformedURLException { + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("Android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.android.chrome"); + options.setAppActivity("com.google.android.apps.chrome.Main"); + options.noReset(); + + URL serverURL = new URL("http://localhost:4723/wd/hub"); + + driver = new AndroidDriver(serverURL, options); + wait = new WebDriverWait(driver, Duration.ofSeconds(30)); + + driver.get("https://v1.training-support.net/selenium"); + } + + @Test + public void loginTestInvalid() throws InterruptedException { + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.xpath("//android.widget.Button[@text=\"Get Started!\"]"))).click(); + + String UiScrollable = "UiScrollable(UiSelector().scrollable(true))"; + driver.findElement(AppiumBy.androidUIAutomator(UiScrollable + ".scrollTextIntoView(\"Login Form\")")); + + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.xpath("//android.widget.TextView[@text=\"Login Form\"]"))).click(); + Thread.sleep(5000); + driver.findElement(AppiumBy.xpath("//android.webkit.WebView[@text=\"Login Form\"]/android.view.View/android.view.View/android.view.View/android.view.View/android.widget.EditText[1]")).sendKeys("admin1"); + driver.findElement(AppiumBy.xpath("//android.webkit.WebView[@text=\"Login Form\"]/android.view.View/android.view.View/android.view.View/android.view.View/android.widget.EditText[2]")).sendKeys("password1"); + driver.findElement(AppiumBy.xpath("//android.widget.Button[@text=\"Log in\"]")).click(); + Assert.assertTrue(driver.findElement(AppiumBy.xpath("//android.widget.TextView[@text=\"Invalid Credentials\"]")).isDisplayed()); + } + + @AfterClass + public void tearDown() { + driver.quit(); + } +} diff --git a/Appium/Project/Activityy1 (1).java b/Appium/Project/Activityy1 (1).java new file mode 100644 index 0000000000..719726232a --- /dev/null +++ b/Appium/Project/Activityy1 (1).java @@ -0,0 +1,62 @@ +package Appium_Project; + +import com.beust.ah.A; +import io.appium.java_client.AppiumBy; +import io.appium.java_client.TouchAction; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import io.appium.java_client.ios.IOSTouchAction; +import io.appium.java_client.touch.offset.PointOption; +import io.opentelemetry.api.baggage.propagation.W3CBaggagePropagator; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.Point; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; + + + +public class Activity1 +{ + // Driver Declaration + AndroidDriver driver; + + // Setting up + @BeforeClass + public void setUp() throws MalformedURLException + { + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + + //Swipping + + } + + @Test + public void addingAndUpdatingTasks() throws InterruptedException { + driver.findElement(AppiumBy.xpath("//android.widget.TextView[@content-desc=\"Keep Notes\"]")).click(); + Thread.sleep(500); + driver.findElement(AppiumBy.xpath("//android.widget.ImageButton[@content-desc=\"New text note\"]")).click(); + driver.findElement(AppiumBy.id("com.google.android.keep:id/editable_title")).sendKeys("Tester"); + //driver.findElement(AppiumBy.id("com.google.android.keep:id/edit_note_text")).sendKeys("This is the text coming from Appium for Notes"); + driver.findElement(AppiumBy.id("com.google.android.keep:id/edit_note_text")).sendKeys("Some Text"); + driver.findElement(AppiumBy.accessibilityId("Navigate up")).click(); + //driver.findElement(AppiumBy.xpath("//android.widget.Button[@content-desc=\"Archive\"]")).click(); + String message = driver.findElement(AppiumBy.xpath("//android.widget.TextView[@resource-id=\"com.google.android.keep:id/index_note_title\" and @text=\"Tester\"]")).getText(); + //Assertion for Keep + //String message = driver.findElement(AppiumBy.id("com.google.android.keep:id/snackbar_text")).getText(); + Assert.assertEquals(message,"Tester"); + } + + +} diff --git a/Appium/Project/Activityy3.java b/Appium/Project/Activityy3.java new file mode 100644 index 0000000000..eddf6ae89e --- /dev/null +++ b/Appium/Project/Activityy3.java @@ -0,0 +1,102 @@ +package Examples; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; + + + +public class Activity3 +{ + // Driver Declaration + AndroidDriver driver; + + // Setting up + @BeforeClass + public void setUp() throws MalformedURLException { + + + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.google.android.calculator"); + options.setAppActivity("com.android.calculator2.Calculator"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + } + + // Test method + @Test + public void calcuations() { + // Perform the summation + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/op_add")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_9")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/eq")).click(); + String sum = driver.findElement(AppiumBy.id("result_final")).getText(); + + // Printing and Assertion + System.out.println("Sum of 5 and 9 is "+ sum); + Assert.assertEquals(sum, "14"); + + //Subtraction + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_1")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/op_sub")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/eq")).click(); + String balance = driver.findElement(AppiumBy.id("result_final")).getText(); + + //Printing and Assertion + System.out.println("When 5 is deducted from 10, you will get "+ balance); + Assert.assertEquals(balance, "5"); + + //Multiplication + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/op_mul")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_1")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/eq")).click(); + String product = driver.findElement(AppiumBy.id("result_final")).getText(); + + //Printing and Assertion + System.out.println("Product of 5 and 100 "+ product); + Assert.assertEquals(product, "500"); + + //Division + driver.findElement(AppiumBy.id("com.google.android.calculator:id/clr")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_5")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_0")).click(); + driver.findElement(AppiumBy.accessibilityId("divide")).click(); + driver.findElement(AppiumBy.id("com.google.android.calculator:id/digit_2")).click(); + String divResult = driver.findElement(AppiumBy.id("com.google.android.calculator:id/result_preview")).getText(); + + //Printing and Assertion + System.out.println("Result if 50/2 is "+ divResult); + Assert.assertEquals(divResult, "25"); + + } + + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Appium/Project/Activityy4.java b/Appium/Project/Activityy4.java new file mode 100644 index 0000000000..a5f0891ef1 --- /dev/null +++ b/Appium/Project/Activityy4.java @@ -0,0 +1,81 @@ +package Examples; + +import io.appium.java_client.AppiumBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.options.UiAutomator2Options; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import java.net.MalformedURLException; +import java.net.URL; +import java.time.Duration; + + +public class Activity4 +{ + // Driver Declaration + AndroidDriver driver; + WebDriverWait wait; + + // Set up method + @BeforeClass + public void setUp() throws MalformedURLException { + // Desired Capabilities + UiAutomator2Options options = new UiAutomator2Options(); + options.setPlatformName("android"); + options.setAutomationName("UiAutomator2"); + options.setAppPackage("com.google.android.contacts"); + options.setAppActivity("com.google.android.apps.contacts.editor.ContactEditorActivity"); + options.noReset(); + + // Server Address + URL serverURL = new URL("http://localhost:4723/"); + + // Driver Initialization + driver = new AndroidDriver(serverURL, options); + wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + } + + // Test method + @Test + public void contactsTest() { + // Find and click the add button + driver.findElement(AppiumBy.accessibilityId("Contacts")).click(); + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.id("com.google.android.contacts:id/floating_action_button"))); + driver.findElement(AppiumBy.id("com.google.android.contacts:id/floating_action_button")).click(); + // Wait for elements to load + wait.until(ExpectedConditions.elementToBeClickable( + AppiumBy.xpath("//android.widget.EditText[@text=\"First name\"]") + )); + + // Enter the details + driver.findElement(AppiumBy.xpath( + "//android.widget.EditText[@text=\"First name\"]" + )).sendKeys("Sreevara"); + driver.findElement(AppiumBy.xpath( + "//android.widget.EditText[@text=\"Last name\"]" + )).sendKeys("Mysore"); + driver.findElement(AppiumBy.xpath( + "//android.widget.EditText[@text=\"Phone\"]" + )).sendKeys("9448488175"); + // Click Save + driver.findElement(AppiumBy.id("com.google.android.contacts:id/toolbar_button")).click(); + + // Wait for contact to save + wait.until(ExpectedConditions.elementToBeClickable(AppiumBy.id("com.google.android.contacts:id/large_title"))); + + // Assertion + String contactName = driver.findElement(AppiumBy.id("com.google.android.contacts:id/large_title")).getText(); + Assert.assertEquals(contactName, "Sreevara Mysore"); + } + + // Tear down method + @AfterClass + public void tearDown() { + // Close the app + driver.quit(); + } +} diff --git a/Cucumber b/Cucumber new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Cucumber @@ -0,0 +1 @@ + diff --git a/Cucumber/Activities/.gitkeep b/Cucumber/Activities/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000