How to open all bmp files in a folder in order in Studio X

For this more advanced scenario, you need “dynamic selectors” - that is , your UI Selector, which determines the file you click on, should change depending on the name of the file. The steps to achieve this are:

  1. Click on the little “wheel” top-right of the For Each File in Folder activity. We want to create a “Variable” or “Value mapping” like bellow. The value we assign here will act as default value and will help us validate our Selector.

  2. Change the name of the FileName variable with the the CurrentFile in you ForEach file loop:

  1. Configure the Click Activity to click on on of the files. Go and edit your selector to depend on the “FileName” variable defined above in the “text” property, by using the double curly braces notation: {{FileName}}. Uncheck Fuzzy Selector and Image methods.
    Note: you can determine the property depending on the file name (“Text”) by using the UI Explorer:

image

image

image

image

  1. Remove any properties that identify the file being clicked on, by order and not by name. In our case “automationId”.

image

  1. Final selector should look similar to:

image

  1. Run the automation and it will click on the files in the File Explorer window (*.json in my case).

1 Like