Automate the Flowchart

abstract To automate a flow, we need to map the flowchart node to the actions performed on the application.
goal Implement the keywords of the flowchart so that actions are automatically performed on the application when the test is run.
steps

Launcher Settings

To automate the flowcharts, first we need to add settings for the launcher like, setting browser, start URL etc.

  1. On the Flowcharts window, click on the drop-down arrow next to Launch and then select Launcher Settings.
  2. Launcher Settings dialog opens.
    1. Select the browser: Chrome
    2. Enter the URL of the application under test. In this case, the URL will be: http://demoapps.testflowchart.com/oc/
  3. Click on Launch to launch the webpage, or you can simply close the dialog. It will save the changes automatically.

Open Automate dialog

  1. Click on any node of the flowchart and select Automate.
  2. Automate dialog opens up.
  3. Observe that the selected keyword is highlighted and displayed in bold on the left pane. The right pane provides space for adding detailed information.
  4. You can select any keyword by clicking on it on the left pane.

Add Steps

info To implement the keyword, we can either record the steps or add them manually.
These steps will be performed automatically during the execution/run.

Record Steps

  1. Record steps for Go to product page keyword:
    1. Select the first keyword i.e; Go to Product page.
    2. Click on Start Record button.
    3. Set the Run settings same as Launcher Settings if prompted. ( This is a one-time process.) Again click on Start Record.
    4. The website opens up in a new browser.
    5. info You can set the Flowcharts window and the OpenCart browser window side by side for ease. While doing so, drag the Automate dialog to the visible portion.
    6. Navigate to Opencart window.
    7. Click on Phone & PDAs tab
    8. Notice that in the right pane of the Automate dialog, your clicks have been recorded and shown as below.
    9. Click on Save Keyword.
    10. Notice that, now the implemented keyword has changed its colour to black.
  2. infoAt any stage of recording the steps, you can stop the recording and start recording again. This gives the user a buffer to make any corrections or to plan further course of action.
  3. Record steps for Add item to cart keyword:
    1. Select Add item to cart keyword.
    2. Click on Start Record if it is not in recording mode.
    3. Navigate to the Open Cart browser window and select a phone : iPhone
    4. Click Add to cart. A Success message appears to show that the item has been added to the cart.
    5. Notice the step added to the Automate dialog.
    6. Click on Save Keyword.
  4. Click on Stop Record button to stop the recording process.
  5. Add Manual Steps

  6. Add steps for Verify item added to cart keyword:
    1. Select Verify item added to cart keyword.
    2. Click on Add Step button or the button.
    3. The Add Step dialog opens. Navigate to Inspect Element tab by clicking on it.
    4. Navigate to the Opencart browser window and press the Ctrl key and hover the mouse on the Success message (Ctrl + Mouse Hover). The green box gets highlighted by a red outline.
    5. Notice that the Add step dialog's Inspect element tab has got populated with the success message's UI Element and UI Element Value.
    6. Click on the Drop-down arrow near UI Element and select the option shown as the image below.
    7. Click on the +(select action/assert) button.
    8. Select Assert Text Equals from the pop-up menu.
    9. Notice the changes in left pane of the Add Step dialog.
      • The Action has been set to Get Text.
      • El has been set to the identified element from the web application.
      • The Assert has been set to Equals and it has the value of the success message.
      • The above means: Get the text from El and assert that it Equals (is the same) as the text specified.
    10. Click on Update button.
    11. The added step looks like this:
    12. Click on Save Keyword.

Run the Flowchart

  1. On the Automate dialog click on Runbutton.
  2. The Run Settings dialog opens. Select Run Normal Path and click the Run button.
  3. During the process of execution/running the flow, the following can be observed:
    1. The target webpage will be launched in a browser.
    2. All the added steps will execute.
    3. Here the Product page will open and the product will get added to cart automatically.
    4. Finally it will verify the success message.

View Report

  1. Click on the Reports button..
  2. The Report opens in a new browser.
  3. Click further on it to see the individual steps performed.
outcome Congratulations! You have successfully automated the keywords in the flowchart and run your first flow!
concepts
  • Automate
  • Keyword
  • Implement Keyword
  • Launcher
  • Recorder
  • Step
  • UI Element
  • Inbuilt Actions