Step-by-Step Guide to Perform Web Application AutomationsFollowing are some of the examples to demonstrate web application automation. Automation a Search Process in a Web ApplicationLet's create a search process for information on a web application and update the search result. In this example, consider web page of Rediff Money where we automate the process of retrieving the real time stock price of a desired company.
Prerequisite: 1. In the Admin menu, add an application of Application Type- WebApps. 2. In the Application Properties panel: · Enter the Login URL as https://money.rediff.com/index.html · Enter the Search URL as https://money.rediff.com/index.html
· Enter the Display Name. 3. Click
the 4. Enter other details as per your requirement. The WebApps application is created. To automate the process of retrieving real time stock price of the company: 1. Create a new process. 2. Create string arguments, CompName and StockPrice to enter the name of the company and store the real time stock price of the same. 3. From the Canvas Tools panel, add Application activity to the Flowchart designer on the Canvas. 4. In the Application Type list, select WebApps. 5. In the Select an Application list, select the available web application that you configured. 6. Click
the 7. Click
the
8. Click the highlighted area. The Field Properties panel of the Web Mode appears. The fields that are mandatory are highlighted with red box.
9. In the Action list, select Set Value. 10. In the Input Source list, select the CompName argument. 11. Enter
a Display Name, and then
click the 12. Click
the 13. Hover over the GET QUOTE> field. The field gets highlighted with red box. 14. Click the highlighted area. The Field Properties panel of the Web Mode of the web application appears. The fields that are mandatory are highlighted with red box. 15. In the Action list, select Click. 16. Enter
a Display Name and then
click the 17. Click
the 18. Click the highlighted area. The Field Properties panel of the Web Mode appears. The fields that are mandatory are highlighted with red box.
19. In
the Action list, select
Get Text. You can click
the 20. In
the Variable Name list,
select StockPrice and
then click the 21. Click
the 22. In the Studio menu, setup the environment and then perform the test run. The process returns the real time stock price of the company entered.
Automating Web Table Extraction Using LoopIn this example, we are extracting the company names and the corresponding % change from the BSE INDICES table available on the Rediff Money web page. Prerequisite: 1. Goto Admin menu and in the Application tab, add a WebApps application in the Application 2. In the Search Properties panel: · Enter the Login URL as https://money.rediff.com/index.html · Enter the Search URL as https://money.rediff.com/index.html
· Enter the Display Name. 3. Click
the The WebApps application is created.
To automate retrieving entire data from a table: 1. Create a new process. 2. Create In arguments, CompName and PercentageChange of String type to store the company name and the corresponding percentage change extracted. Create another argument, RowExists of Boolean type to check if the table row exists, and RowIndex of Int32 type to specify the index of the row to indicate the index of the row where the action must be performed. Set RowIndex as 0 to start data extraction from the first row of the table. 3. From the Canvas Tools panel, add Application activity to the Flowchart designer on the Canvas. 4. In the Application Type list, select WebApps. 5. In the Select an Application list, select the available web application that you configured. 6. Click
the a. Indicate the system to check if intended row exists. b. Verify if intended row exists. c. Capture the first step of data extraction. d. Perform iteration over the first step of data extraction using While loop. Indicate System to Check If Intended Row Existsa. Locate
the required table and then click the b. Press Alt key from the keyboard and select two rows of the table. Click the highlighted area to indicate the column from where you want to check if the row exists for data extraction. The entire column gets highlighted and the Field Properties pane appears.
Verify if Intended Row Existsa. In the Action list, select Control Exists. This interaction checks if the intended row of the required table exists.
b. In the Display Name field, enter a desired name. c. In the Variable Name list, select RowExists argument created in the Parameter bar. d. In the Item Index list, select RowIndex argument created in the Parameter bar. This provides the index of the element for extraction. Other fields are auto filled as per details of the data selected. e. Click
the Capture First Step of Data Extraction from Intended Rowa. Click
the b. Press Alt key from the keyboard and select two rows of the Index column. Click the highlighted area to indicate the column to extract data. The entire column gets highlighted and the Field Properties pane appears.
c. In the Action list, select Get Attribute to fetch the name of the company. d. In the Display Name field, enter a desired name. e. In the Variable Name list, select CompName argument created in the Parameter bar. f. In the Item Index list, select RowIndex argument created in the Parameter bar. This provides the index of the element for extraction. Other fields are auto filled as per details of the data selected. g. Click
the h. Click
the i. Press Alt key from the keyboard and select two rows of the % Change column. Click the highlighted area to indicate the column to extract data. The entire column gets highlighted and the Field Properties pane appears. j. In the Action list, select Get Attribute to fetch the name of the company. k. In the Display Name field, enter a desired name. l. In the Variable Name list, select PercentageChange argument created in the Parameter bar. m. In the Item Index list, select RowIndex argument created in the Parameter bar. This provides the index of the element for extraction. Other fields are auto filled as per details of the data selected. n. Click
the o. Click
the Perform Iteration Over First Step of Data Extraction Using While Loopa. Double click the Application activity and drop While activity below ControlExistsInteraction block. b. Move other blocks inside the When activity to create a loop over the steps captured. c. Set the While condition that until RowExists argument is true, extract the company name else break the loop. You can set a condition inside the While loop to break the loop if you want to extract data until a specified row. d. Add Assign activity and increment the value of RowIndex by 1 to let the loop counter move to the next row index for data extraction. You can store the extracted data
in an excel or use them fr further processing. To view the output
in Automation Studio , let's add WriteLine
activity. You can assign this process to a robot, if you want
to execute this process outside Automation Studio.
7. Add a WriteLine activity below data extraction block and in the Text field, enter CompName+ " : " +Percenatge to print the company name and their corresponding percentage change. 8. Save the process. 9. Setup the environment and then perform test run. Following is the output displayed in the console:
Automating Smart Google Web Toolkit (GWT) Based applicationsIn this example we are extracting data from a table that is present in a Smart GWT based application. Prerequisite: 1. In the Admin menu, add an application of Application Type- WebApps. 2. In the Search Properties panel: · Enter the Login URL as https://www.smartclient.com/smartclient/showcase/?id=adaptiveFilterFS · Enter the Search URL as https://www.smartclient.com/smartclient/showcase/?id=adaptiveFilterFS
· Enter the Display Name. 3. Click
the 4. Enter other details as per your requirement. The WebApps application is created.
To automate retrieving data from an entire table: 1. Create a new process. 2. From the Canvas Tools panel, add Application activity to the Flowchart designer on the Canvas. 3. In the Application Type list, select WebApps. 4. In the Select an Application list, select the available Smart GWT application that you configured. 5. Click
the 6. Locate
the table and then click the a. Extract the SKU column from the first row. b. In the Find By list, select sclocator and copy the generated code in a notepad file.
c. Extract the SKU column from the second row. d. In the Find By list, select sclocator and copy the generated code below the first code in the same notepad file. Following is a sample of the generated values:
The generated values of the sclocator contains row specific details for the row part, and rest of the details are the same for both the values as shown below:
e. Delete the specific details and add a placeholder for loop index to make it as a generic sclocator that is used for looping. In the above example, remove the specific information related to itemName and SKU fields. The itemID field and row identifier after the SKU field can be used for making placeholder for loop index. f. After deleting the specific information, use either of the following as a value of the sclocator in loop:
Automating Web Table Extraction Without LoopIn this example, we are extracting the BSE Sensex details from the BSE INDICES table available on the Rediff Money web page.
Prerequisite: 1. Goto Admin menu and in the Application tab, add a WebApps application in the Application 2. In the Search Properties panel: · Enter the Login URL as https://money.rediff.com/index.html · Enter the Search URL as https://money.rediff.com/index.html
· Enter the Display Name. 3. Click
the The WebApps application is created.
To automate retrieving details of entire table of BSE indices: 1. Create a new process. 2. Create an Out argument, SensexTable of type DataTable to store the datatable that gets created during the extraction. If you do not create an argument of DataTable type, it gets created at the time of field configuration and you can define the name.
3. From the Canvas Tools panel, add Application activity to the Flowchart designer on the Canvas. 4. In the Application Type list, select WebApps. 5. In the Select an Application list, select the available web application that you configured. 6. Click
the 7. Click
the
8. In the Action list, Get Table Data is selected by default.
9. In the ExtractBy list, GetText is selected by default. You can change it to InnerText if the datatable is empty. Inner Text option is used when you want to fetch data from the hidden rows of the table. This data is already retrieved when the page loads, however the data is not visible until you click More>>.
10. In the Display Name field, enter a desired name. 11. In the Find By list, css3seelctor is selected by default. Depending on the html tagging, css3xpath can also be available in this list. 12. In the Variable Name list, select the argument, SensexTable. 13. Use
14. Click
the 15. Click
the 16. Create an In argument, ExcelOutput to read and view the datatable extracted. 17. Double click the Export Data Table activity below the Get Data activity.
18. In the DataTable Name list, select the SensexTable argument to provide the input to the Export Data Table activity. 19. In the Export File Path list, select the ExcelOutput argument to export the datatable in the excel files saved in your system. 20. In the File Type list, select Excel. 21. In the Studio menu, setup the environment and then perform the test run. The process returns the excel file containing the BSE Sensex detail.
|