Interacting with UI Form via a test label instead of a label

Certified Senior Developer
This is with regards to Performance Testing. We are using Locust as the tool for PT.
We have certain Interface components where label is not defined as per design. 
When writing PT scripts Locust for Appian provides functions to interact with a "testLabel" if label is not available.
I want to interact with a dropdown using a test label. But the appian interface designer does not provide an attribute called "testLabel" for dropdown component.
Reference:

  Discussion posts and replies are publicly visible

Parents
  •   could you please suggest a code how to use testLable if label is not available on click download excel file link? as I am new to Appian-locust.

  • 0
    Certified Senior Developer
    in reply to mohammads3449

    Hi  

    Usually we don't included download link as part of perf test. I am guessing you want to measure the download time for the file.

    I don't see any functions provided in "appian for lucust" for this. So I guess you may need to,

    1. Get the _documentDownloadLink from json response of your the last ui form interact call.

    2. Form the download link url using "/suite/rest/a/content/latest/{opaqueContentId}/o" replace opaqueContentId with _documentDownloadLink

    3. Call self.client.get using the above url.

  • Thanks for update  

    I tried to follow above steps you suggested. But I am get below error:

    Error report
    # occurrences Error
    ------------------|-------------------------------------------------------------------------------------------------------------------------------------------1 GET /suite/rest/a/content/latest/_documentDownloadLink/o: HTTPError('500 Server Error: 500 for url: /suite/rest/a/content/latest/_documentDownloadLink/o')
    ------------------|-------------------------------------------------------------------------------------------------------------------------------------------

    On hitting manually below URL :

    xxxxx.appiancloud.com/.../o

    getting below error on browser:

    {"error":"APNX-1-0000-000","message":"An error was encountered while processing your request. "}
  • 0
    Certified Senior Developer
    in reply to mohammads3449

    Hi, Hope you have replaced with the actual encoded string from last response.

    For example this is a section from response json. 

    "link": {
        "_documentDownloadLink": "ioB7vr6GjFvUNxPq2Miwv1qGKHukxgjgKuFwb6p5zZv_2wQwAlSDT3Igbo",
        "_cId": "f12c63bb69315fb33e3137d47088dfdd",
        "document": {
          "id": 771239,
          "#t": "CollaborationDocument"
        },
        "label": "",
        "version": -1,
        "metricKey": "",
        "#t": "DocumentDownloadLink"
      }

    So the document url will be,

    /suite/rest/a/content/latest/ioB7vr6GjFvUNxPq2Miwv1qGKHukxgjgKuFwb6p5zZv_2wQwAlSDT3Igbo/o

  • Hi, Yes same I did.

    Below is the section from response json.

    link":{
    "_documentDownloadLink":"ioBRM6r2ZR-dSBC6M8A0YS40UJXHFJgjNtYJ5Ng6MK1HKkLRJarnhLJCk",
    "_cId":"321f7b1bea2d292db37226961ae7b5f6",
    "testLabel":"Download Activity Task Loader",
    "document": {
    "id":223327,
    "#t":"CollaborationDocument"
    },
    "label":"",
    "version":-1,
    "metricKey":"",
    "#t":"DocumentDownloadLink"}

    Also how to correlate above _documentDownlaodLink value in Appian Locust sail Ui Form?

  • 0
    Certified Senior Developer
    in reply to mohammads3449

    Able to call the download link successfully

    "GET /suite/rest/a/content/latest/ioBRBhHZ1P0RUrscUV0M2LUTUPJN2o1Gn3nC7TwumKibZU5Y6k1G4ZL7BQ/o HTTP/11" 200

    Locust task looks like this

        @task
        def download_document(self):
            headers = self.interact.setup_sail_headers()
            
            response = self.client.get(
                f"/suite/rest/a/content/latest/{self.opaqueContentId}/o",
                allow_redirects=True,
                name=f"08 - Download Document - {self.task_name}",
                headers=headers
            )

    Like I mentioned, save the self.opaqueContentId from previous response (here I have used a custom function)

    self.opaqueContentId = find_unique_key(json_response, "_documentDownloadLink")

    You will need to traverse the json using standard python and correlate using a label field.

Reply
  • 0
    Certified Senior Developer
    in reply to mohammads3449

    Able to call the download link successfully

    "GET /suite/rest/a/content/latest/ioBRBhHZ1P0RUrscUV0M2LUTUPJN2o1Gn3nC7TwumKibZU5Y6k1G4ZL7BQ/o HTTP/11" 200

    Locust task looks like this

        @task
        def download_document(self):
            headers = self.interact.setup_sail_headers()
            
            response = self.client.get(
                f"/suite/rest/a/content/latest/{self.opaqueContentId}/o",
                allow_redirects=True,
                name=f"08 - Download Document - {self.task_name}",
                headers=headers
            )

    Like I mentioned, save the self.opaqueContentId from previous response (here I have used a custom function)

    self.opaqueContentId = find_unique_key(json_response, "_documentDownloadLink")

    You will need to traverse the json using standard python and correlate using a label field.

Children