Skip to content

Instantly share code, notes, and snippets.

@anjesh
Last active February 14, 2019 16:58
Show Gist options
  • Save anjesh/e01c68ca59845d6f3ae4d1acf340806d to your computer and use it in GitHub Desktop.
Save anjesh/e01c68ca59845d6f3ae4d1acf340806d to your computer and use it in GitHub Desktop.
RC Bulk Publishing Using Katalon

Setup

image

To test in staging RC site

  • Create a file called rc-contracts.csv and populate with contract-ids that need to be published. Make sure that the header of the column is id
  • Click Data Driven Tab in the bottom part of the screen
    • Upload the file rc-contracts.csv in Data Driven window by clicking Add CSV file
    • If the file exists, delete the file and reupload rc-contracts.csv
  • Login to admin-staging.resourcecontracts.org
  • click rc-staging under Test suites
    • click Play to run that rc-staging scripts

To run in production RC site

  • Create a file called rc-contracts.csv and populate with contract-ids that need to be published. Make sure that the header of the column is id
  • Click Data Driven Tab in the bottom part of the screen
    • Upload the file rc-contracts.csv in Data Driven window by clicking Add CSV file
    • If the file exists, delete the file and reupload rc-contracts.csv
  • Login to admin.resourcecontracts.org
  • click rc-production under Test suites
    • click Play to run that rc-production scripts

Note: Donot click Play Suite or Play All, that will run both rc-staging and rc-production

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>RC Bulk Publishing Tool</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">rc-staging</td></tr>
</thead>
<tbody>
<tr><td>loadVars</td><td>rc-contracts.csv<datalist><option>rc-contracts.csv</option></datalist></td><td></td>
</tr>
<tr><td>open</td><td>https://admin-staging.resourcecontracts.org/contract/${id}<datalist><option>https://admin-staging.resourcecontracts.org/contract/{id}</option><option>https://admin.resourcecontracts.org/contract/{id}</option><option>https://admin-staging.resourcecontracts.org/contract/${id}</option><option>https://admin.resourcecontracts.org/contract/${id}</option></datalist></td><td></td>
</tr>
<tr><td>waitForPageToLoad</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>storeElementPresent</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button</option><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]</option></datalist></td><td>needCompleteAction</td>
</tr>
<tr><td>if</td><td>${needCompleteAction} == true<datalist><option>${elementFound} == true</option><option>${needCompleteAction} == true</option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>{$id} found to "Complete"<datalist><option>{$id} found to publish</option><option>{$id} found to "Complete"</option></datalist></td><td></td>
</tr>
<tr><td>clickAndWait</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]</option></datalist></td><td></td>
</tr>
<tr><td>else</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>${id} not found for completion, trying publishing<datalist><option>${id} not found</option><option>${id} not found for completion, trying publishing</option></datalist></td><td></td>
</tr>
<tr><td>endif</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>storeElementPresent</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]</option><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button</option><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]</option></datalist></td><td>needPublishAction</td>
</tr>
<tr><td>if</td><td>${needPublishAction} == true<datalist><option>${needCompleteAction} == true</option><option>${elementFound} == true</option><option>${needPublishAction} == true</option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>{$id} found to "Publish"<datalist><option>{$id} found to "Complete"</option><option>{$id} found to publish</option><option>{$id} found to "Publish"</option></datalist></td><td></td>
</tr>
<tr><td>clickAndWait</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]</option></datalist></td><td></td>
</tr>
<tr><td>else</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>${id} not found for publishing<datalist><option>${id} not found</option><option>${id} not found for publishing</option></datalist></td><td></td>
</tr>
<tr><td>endif</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>endLoadVars</td><td><datalist><option></option></datalist></td><td></td>
</tr>
</tbody></table>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">rc-production</td></tr>
</thead>
<tbody>
<tr><td>loadVars</td><td>rc-contracts.csv<datalist><option>rc-contracts.csv</option></datalist></td><td></td>
</tr>
<tr><td>open</td><td>https://admin.resourcecontracts.org/contract/${id}<datalist><option>https://admin-staging.resourcecontracts.org/contract/${id}</option><option>https://admin-staging.resourcecontracts.org/contract/{id}</option><option>https://admin.resourcecontracts.org/contract/{id}</option><option>https://admin.resourcecontracts.org/contract/${id}</option></datalist></td><td></td>
</tr>
<tr><td>waitForPageToLoad</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>storeElementPresent</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]</option><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button</option></datalist></td><td>needCompleteAction</td>
</tr>
<tr><td>if</td><td>${needCompleteAction} == true<datalist><option>${needCompleteAction} == true</option><option>${elementFound} == true</option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>{$id} found to "Complete"<datalist><option>{$id} found to "Complete"</option><option>{$id} found to publish</option></datalist></td><td></td>
</tr>
<tr><td>clickAndWait</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]</option></datalist></td><td></td>
</tr>
<tr><td>else</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>${id} not found for completion, trying publishing<datalist><option>${id} not found for completion, trying publishing</option><option>${id} not found</option></datalist></td><td></td>
</tr>
<tr><td>endif</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>storeElementPresent</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]</option><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Complete")]</option><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button</option></datalist></td><td>needPublishAction</td>
</tr>
<tr><td>if</td><td>${needPublishAction} == true<datalist><option>${needPublishAction} == true</option><option>${needCompleteAction} == true</option><option>${elementFound} == true</option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>{$id} found to "Publish"<datalist><option>{$id} found to "Publish"</option><option>{$id} found to "Complete"</option><option>{$id} found to publish</option></datalist></td><td></td>
</tr>
<tr><td>clickAndWait</td><td>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]<datalist><option>//*[@id="page-content-wrapper"]/div/div/div/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[4]/form/button[contains(.,"Publish")]</option></datalist></td><td></td>
</tr>
<tr><td>else</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>echo</td><td>${id} not found for publishing<datalist><option>${id} not found for publishing</option><option>${id} not found</option></datalist></td><td></td>
</tr>
<tr><td>endif</td><td><datalist><option></option></datalist></td><td></td>
</tr>
<tr><td>endLoadVars</td><td><datalist><option></option></datalist></td><td></td>
</tr>
</tbody></table>
</body>
</html>
id
2754
2755
2756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment