Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Dynamicly Select a checkbox

image

 

I have a list with filenames I want to read them and then login to docparser to delete all correponding file in the uploaded items queue.

I maded the same process in UiPath and it worked, but the user wants it in winautomation. I uipath I loop the list scrape the table and then check the values to define on which row the file is and use the rowindex in a customselector. I winautomation I managed to get as far as comparing the filename with the columns, but I'm unable to build the customselector I'm not able to get the rowindex property. How would I go about checking the checkbox for each correspondingfile? First I tried not to scrape the table and just check if the webpagecontain the filename, but that dosn't return the item, just a boolean so no Idea how I would build a selector from that, any help?

.


ADMIN

Hello Daniel,


Please note that you can extract the data using the Extract Data From WebPage" Action. Then loop through every name and if the name condition is matched, use this LoopIndex to the selector, so as to click the checkbox needed. 


At this point, please know that you can use variables to the selectors and create dynamic selectors (E.g. div[class="check-box"] > li:eq(%LoopIndex%) > a )


Please try using the "Loop" Action, so as to store the Index of the loop.


Does this solve the issue you are confronting?

Thanks for the reply christos.

I already loop the results and I manage to find the corresponding element, but I have no Idea on how to buld dynamic selectors with winAutomation.

this is the current selector:

Selector
tr[id="file_row_13492363"] > td[class="checkbox_wrapper"]

I gues I would have the remove the rowId and where do I add the variabe?

ADMIN

Hello Daniel,


Please elaborate further on the selectors, since I do not have access to this website. 


Could you please capture 2 consecutive selectors with the UISpy and share them with us?


Do you see any attribute of the selector which corresponds to the ordinal of the element (i.e., if it is first, second etc.)?


Please in the meantime, try the following:


tr:eq(%LoopIndex%)> td[class="checkbox_wrapper"]

The ordinal is -1. I included a screensht of the available properties

ordinal1.png
(19.1 KB)

Is loopindex a sytemvariable or do I have to manualy update it?

ADMIN

Hello Daniel,


Thank you for the above information.


Regarding the %LoopIndex%, it is the default variable name that stores the loop index, when you use the "Loop" action.


Regarding the selectors, in the Selector Builder, in the top left drop-down menu select custom and copy/paste the selector here. Please do the same for the next checkbox of the webpage.


I will be looking forward to hearing from you.

When I do so it says variable LoopIndex dosn't exist. Thanks for the help you're verry polite :)

This is a screenshot of the flow

flow.png
(161 KB)
ADMIN

Please try using the "Loop" Action. If you want to use the "For Each" action, then you have to create a variable and increase it after every loop. 

Please see image below for more information.


That seems to bring me closer, it does click on the correct row, but instead of checking the checkbox it opens the side menu what would happen iff you click on the filename, I use the set checkbox state in webpage activity, is this the correct one? Once again thank you for all your help and patientce, you're awesome

ADMIN

Hello Daniel,


Regarding the issue you are confronting, please use the "Click Link on Web Page" Action instead.


Additionally, if the action clicks on a different element than the one supposed to click, then it is a selectors configuration issue. 


Please review the selector again and make the necessary changes so as to refer to the correct element.

It clicks on the correct element, but instead of checking the checkbox it opens the details, like if I would click on the other element. I included a video to illustrate what I mean, the highlighted part is what the robot does, the other clicks I did to illustrate it should check the checkbox instead it opens the detail

wmv
ADMIN

Hello Daniel,


Could you please also share a screenshot of the tree of the element via the developers tool and the selector that you have configured?

This is the html for the element:



  <div class="content_pane content_pane_full file_list_background" id="file_list_content_pane">

   
    <table id="file_list_table" class="table table-hover" data-onload-file="" data-onload-tab="">
              <tr class="file_row_item file_row" id="file_row_13528656" data-id="13528656">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528656">
          </td>
          <td class="subject_wrapper">
            VDB1069568 - Wessem Belgium NV.pdf          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/mT9uRxXpAP5dxnsXNcV0qoJM6DBXTfO2tGSQSe-0qYexAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528655" data-id="13528655">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528655">
          </td>
          <td class="subject_wrapper">
            VDB1068055 - Rovagro NV.pdf          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/b4uobas8Ehn6dEo_ooSn1rcTRQTBN_xllkW2hBT-WPqxAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528654" data-id="13528654">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528654">
          </td>
          <td class="subject_wrapper">
            VDD1072008 - Jörg Reiter Handelsvertretungen.PDF          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/pUO-veJMdtB3ikifn5rXXzpQjQrFsfHxG5uYqNkS9zixAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528652" data-id="13528652">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528652">
          </td>
          <td class="subject_wrapper">
            VDF1071867 - michel leclercq - kopie.PDF          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/lvtRUQrr4QQZ7zcFD6QG5UPL2iW5r2P92EpfI-iERvCxAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528651" data-id="13528651">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528651">
          </td>
          <td class="subject_wrapper">
            VDB005169 - FOURNY.pdf          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/nOq96m2p4Z4UwtN8d9Xc8kjPW2_-nzLWXHHWaS03czuxAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528650" data-id="13528650">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528650">
          </td>
          <td class="subject_wrapper">
            VDB005176 - KMO-ZONE SPELVER.pdf          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/pvAy5A5HUru5C_XMBK1CTM-GEkYMhNlPm4pAZMlPre6xAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528649" data-id="13528649">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528649">
          </td>
          <td class="subject_wrapper">
            VDB1067706 - Aldoplastic GmbH.pdf          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/7NQ8c3i0PA7d4wOMSKY9s7LBnYvoaLlsQ341-9HY-iKxAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528647" data-id="13528647">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528647">
          </td>
          <td class="subject_wrapper">
            VDB005164 - Buchen Industrial Services N.V..pdf          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/yQ1S2dMY-BGuJg5DP6i-bVR9Uh8xWw1Gx7XErLwPz_2xAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
              <tr class="file_row_item file_row" id="file_row_13528646" data-id="13528646">
          <td class="checkbox_wrapper">
            <input type="checkbox" data-id="13528646">
          </td>
          <td class="subject_wrapper">
            TOL1070898 - Scalabor.pdf          </td>
          <td class="file_status_info">

                                                        &nbsp;
                <a class="table-hover-link muted" title="Download as Excel" href="https://api.docparser.com/v1/document/media/C_Y9iScoQ-vFPbnTtzRPGRLpeQ5OzIZDmheOVP0dXvaxAnOXehIyjXHo0Dce5xeTme9lndqoWTJr5e6ko1Rud11MNaV_cTwaKtpbxiVCHbM/data">
                  <i class="far fa-download fa-fw"></i> Excel Download
                </a>
                         
           
           
           
           
          </td>
          <td class="uploaded_at_wrapper">
            <span class="tooltip_trigger" data-toggle="tooltip" data-placement="top" title="received 11/15/2019 - 02:54 AM">
              Nov 15            </span>
          </td>
        </tr>
          </table>
  </div>
  <div id="file_detail_view"></div>



I use the exact selector as you purposed

Login or Signup to post a comment