Before we start, you have to create and save a blank Excel file. This will be used for the storing of data that will be gathered by the automated script. 


Part I. Entering a Product


Step 1. Create a String variable named input. Since the product will be asked from the user, the output will be stored in this variable.

Step 2. Insert an InputDialog activity and enter the values you prefer for Title and Label.





Step 3. Under Properties, search for Result and set its value to "input". This means that the result of the InputDialog will be stored into the input variable.



Part II. Searching for the Product on Bonanza


1. Insert an Open Application activity and set the value of File Name to the URL of Bonanza which is "https://www.bonanza.com/".


2. Insert a Set Text activity, click "Select Element on Screen", and click the search box on Bonanza. Set the value of Text to "input".


3. Insert a Mouse activity that will click the Search button on Bonanza.



4. Insert an Excel Sequence activity and enter the file path of the spreadsheet you created earlier.


5. Insert an Update Row activity inside the Excel Sequence and set its values with the appropriate values. The purpose of this activity is to simply put the different categories - Site Name, Sellter, Item, Price, and URL - in the first row of the sheet.


6. Insert a Find Children activity and select the table of results on Bonanza. In the next step, we will manually set/change the properties of this activity.


7. Look for Selector under Properties and you will see the SelectorString of the element you've chosen. Since the product that we will search for is not fixed because it depends on the user's input, this value should be flexible. Look for the value of TabTitle and change it to "*Bonanza*". It means whatever the tab's title is, as long as it has the word "Bonanza", it will work.


8. Look for Filter under Properties and change the value of CssSelector to "div.list_style_row". We have selected the whole table of results, but we're only specifically looking for the item's name, seller, and price. So, first, we will select each row of products by setting the value of CssSelector to "div.list_style_row".


9. Create a List<RaxUIAutomationElement> variable named productsList. The children found by Find Children activity will be stored in this variable.


10. Back to Find Children, change the value of Scope to Subtree and set the value of Found Children to productsList.


11. Insert a For Each activity and select DesktopAutomation.Core.Implementation.RAXUIAutomationElement as its type.


12. Set the value of this activity to "productsList" and insert a Sequence activity inside.


13. Insert a Find Children activity inside the Sequence activity. We will use this activity to get the item's name.


14. Set the value of Element under Properties to "item". Instead of selecting an element on screen, we will manually set the value for the element. 


15. Look for Filter again and set the value of CssSelector to "span.results_title". This is the element of each item's name.


16. Create another List<RaxUIAutomationElement> variable named nameList. Same with the previous similar variable above, the found item's names will be stored in this variable.


17. Change the value of Scope to Subtree and set the value of Found Children to nameList.


18. Insert a Get Text activity. We will now get the names gathered by the Find Children activity.


19. Create a String variable named name. The text that will be gathered by the Get Text activity will be stored in this variable.


20. Set the value of Element to "nameList(0)" and Result to "name". We only want to get the first instance of the variable nameList thus the reason for nameList(0).


21. Create an Int32 variable named numProducts. This script will only get the first 50 results. So, we need a variable that will check how many products have been gathered so far.


22. Insert an If activity and set its condition to "numProducts >=50". Also, insert a Sequence activity inside Else.


23. Insert a Find Children activity inside the Sequence and set the value of Element to "item". This activity will be used to get the price of each item.


24. Look for Filter and set the value of CssSelector to "span.results_price1".


25. Create a List<RAXUIAutomationElement> variable named priceList and a String named price.


26. Change the value of Scope to Subtree and set the value of Found Children to priceList. 


27. Insert a Get Text activity and set Element to "priceList(0). Also, set the value of Result to "price".


28. Insert another Find Children activity and set the value of Element to "item". This activity will be used to get each item's seller.


29. Look for Filter and set the value of CssSelector to "a.link_to_profile".


30. Create a List<RAXUIAutomationElement> variable named sellerList and a String named seller.


31. Change the value of Scope to Subtree and set the value of Found Children to sellerList. 


32. Insert a Get Text activity and set Element to "sellerList(0). Also, set the value of Result to "seller".


33. Insert an Excel Sequence and set the file path to the spreadsheet you created.


34. Create an Int32 variable named row with a default value of 2.


35. Insert an Update Row and set its values with the appropriate values. Set Worksheet to "Sheet1", Row to "row.ToString", and Values to "{"Bonanza",seller,name,price,url}".


36. Insert two Assign activities for the incrementation of numProducts and row variables.


37. After with the sequence of activities inside Else, insert a Sequence activity inside Then. 


38. Insert a Message Box activity and set its Content to "Finished!" and a Break activity afterwards. This sequence means if the condition of the If activity returns true, 50 results have been gathered and it will inform the user that the workflow is finished. The Break activity will terminate the ForEach loop thus completing the workflow.


And you are done! Upon executing the workflow, it should ask for your input of a product. Afterwards, it will automatically search the product on Bonanza and gather the first 50 results thus providing you the product's name, price, seller, and URL in a Spreadsheet. To read more tutorials, click here.