471,092 Members | 1,034 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 471,092 developers and data experts.

Clicknium Automation Sample Solution - Customer Onboarding

  1. Clicknium Automation Sample Solution - Customer Onboarding

This is a sample of customer onboarding solution with clicknium web automation.

For one enterprise, customer onboarding has a significant impact on a customer willingness of using your product. You may define the customer onboarding process in your company internally,for example, new customer information adds into CRM(customer relationship management) system. If you can automatically process customer onboarding, the efficiency will be significantly improved. Here we demonstrate one customer onboarding automation solution.
  • load the missing customer information from CSV file.
  • open CRM system.
  • iterate the records in CVS file to register customer information into CRM.
  1. Run this sample
  • follow Clicknium getting started to set up develop environment.
  • clone sample repo.
git clone https://github.com/clicknium/clicknium-samples.git
  • open the folder 'CustomerOnboarding' in Visual Studio code.
  • through pip install the dependent packages.
requests is used to download the CSV file and pandas is used to read CSV file.

Expand|Select|Wrap|Line Numbers
  1. pip install requests
  2. pip install pandas
  • open app.py in Visual Studio Code.
  • press F5 to debug the sample or press CTRL+F5 to run sample.
You will see the result as below:

  1. The Purpose of the Sample
  • open the testing CRM web portal.
  • get the url of CSV.
  • download the CSV file.
Expand|Select|Wrap|Line Numbers
  1. tab = cc.edge.open("https://developer.automationanywhere.com/challenges/automationanywherelabs-customeronboarding.html")
  2. url = tab.find_element(locator.customeronboarding.developer.a_downloadcsv).get_property("href")
  3. excelFile = requests.get(url)
  4. temp_file = os.path.join(os.getcwd(), 'missing.csv')
  5. open(temp_file, 'wb').write(excelFile.content)
  6. data = pd.read_csv(temp_file)
  • iterate the records in CVS file to register customer information into CRM.

Expand|Select|Wrap|Line Numbers
  1. for idx, item in data.iterrows():
  2. tab.find_element(locator.customeronboarding.developer.text_customername).set_text(item[0])
  3. tab.find_element(locator.customeronboarding.developer.text_customerid).set_text(item[1])
  4. tab.find_element(locator.customeronboarding.developer.text_primarycontact).set_text(item[2])
  5. tab.find_element(locator.customeronboarding.developer.text_street).set_text(item[3])
  6. tab.find_element(locator.customeronboarding.developer.text_city).set_text(item[4])
  7. tab.find_element(locator.customeronboarding.developer.select_state).select_item(item[5])
  8. tab.find_element(locator.customeronboarding.developer.text_zip).set_text("%05d" % item[6])
  9. tab.find_element(locator.customeronboarding.developer.email_email).set_text(item[7])
  10. if item[8] == "YES":
  11.     tab.find_element(locator.customeronboarding.developer.radio_activediscountyes).set_checkbox()
  12. else:
  13.     tab.find_element(locator.customeronboarding.developer.radio_activediscountno).set_checkbox()
  15. if item[9] == "YES":
  16.     nda = 'check'
  17. else:
  18.     nda = 'uncheck'
  19. tab.find_element(locator.customeronboarding.developer.checkbox_nda).set_checkbox(check_type=nda)
  20. tab.find_element(locator.customeronboarding.developer.button_submit_button).click()
In the code above, you can see:
  • The locator is separated from code, so the locator store can be managed independently. If the CRM system is upgraded, the locator will be changed as well and the locator store is updated accordingly.
  • Easy to select options from dropdown list: tab.find_element(<locator>).select_item(<option>)
  • Easy to check radio button/checkbox: tab.find_element(<locator>).set_checkbox()
  1. Locator
The Locator is the identifier of a UI element, which can be recorded and edited in clicknium vs code extension.

In this sample, you can open the locator in Visual Studio Code, for example:

Clicknium will automatically select the attribute to identify web element, and show all attributes of this element. It is easy to choose other attributes in Visual Studio Code as well as you want.
  1. Comparison with Selenium
  • You have to download the web driver in Selenium with the version matching exactly the browser. In this example, the Edge browser version is 103.0.1264.62, so there is a need to download the same version, MS Edge web driver first.
  • Selenium does not support checking operations with radio button, by click instead.
Expand|Select|Wrap|Line Numbers
  1. driver.find_element('id', 'activeDiscountYes').click()
  • Need to import additional class to wrapper to select options from the dropdown list.
Expand|Select|Wrap|Line Numbers
  1. from selenium.webdriver.support.select import Select
  2. Select(driver.find_element('id', 'state')).select_by_value(item[5])
  • Different running time In this sample, 7 records need to be filled, with each record submit 10 fields. From the log, we can see Clicknium is running faster than selenium.
Expand|Select|Wrap|Line Numbers
  1. [clicknium] Start to fill data:2022-07-21 16:10:15.938903
  2. [clicknium] End to fill data:2022-07-21 16:10:18.460162
  4. [selenium] Start to fill data:2022-07-21 15:08:30.528693
  5. [selenium] End to fill data:2022-07-21 15:08:37.517574
  1. More samples

You can refer to more automation samples/solutions in clicknium github samples.
Send email to us or Join Slack.
3 Weeks Ago #1
0 5056

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Gaffar | last post: by
1 post views Thread by JPK | last post: by
12 posts views Thread by elziko | last post: by
2 posts views Thread by =?Utf-8?B?SmVmZnJleQ==?= | last post: by
reply views Thread by mam | last post: by
10 posts views Thread by cj2 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.