Question
Shuurgan
CN
Last activity: 18 Nov 2024 19:29 EST
I want you to help me figure out how to do this correctly
Hello,I want to click all the checkboxes in sequence. The specific operation is as follows: click the first checkbox and then click the note to enter the page corresponding to the checkbox and then download and other operations, then return to the previous page and click the second checkbox. But there is a problem here, after returning to the page, you must click the previous checkbox again to cancel the check state before you can continue to click other checkboxes. My current design can only click to enter the first checkbox, but cannot cancel the check state, so I can't judge whether the loop I designed can click all the checkboxes. What should I do? BAO
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 18 Nov 2024 19:29 EST
Pegasystems Inc.
US
@BAOX17175074 Here is some documentation you might find helpful.
Pegasystems Inc.
US
If you have a list of cloned objects (in this case rows), that list represents the current objects on screen. If during your automation, that list changes (such as navigating away from the current screen to a new one and then back to the original screen where the table will load again with the same data but each object on-screen is now a new instance of the original list), then you must come up with a constant list to use for your iteration.
I would;
- Identify something unique about each row. If there is a field in each row that is unique or perhaps some ordinal number indicating its order, that can serve as your identifier for that row. We will use this to keep track of which rows have been processed.
- Write an automation to iterate through each row and add the identifier from Step 1 into a LookupTable. This table will be the list you iterate through.
- Write an automation to locate a row given the identifier you have recorded in the table.
- Write an automation that uses the key value returned by Step 3 to perform the operation on that row (check the checkbox, add the note, return to the original list, etc...).
- Combine these together to complete the task.
You can test each of these individually to make sure you understand how they'd work together.
Shuurgan
CN
@ThomasSasnett How can I use a unique identifier to identify a checkbox if I cannot determine if it is in a row on a web page? And I have confirmed that my web page URL does not change here, only the part where the checkbox is clicked and the customer information changes. Will such a change also initialize the variables I store? BAO
Pegasystems Inc.
US
@BAOX17175074 I don't understand your question here. You must first identify the row and determine a unique way to identify the row. There will most certainly be some control you can use as a container for each row. This container is the object you'd enable UseKeys on. This will be what you look inside of for some unique way to identify it. I suggest using he interrogation for "Select Element" option to help you locate the object that is being used as the row here.
Once you have a means to uniquely identify each row, you can then iterate through the clone collection to store that unique identified in a lookup table to serve as the list that you will iterate over while performing your automation. You will need to write an automation that converts that identifier into a key for the row that it appears in and use that key to perform operations against a given row.
Pegasystems Inc.
US
@BAOX17175074One thing I would suggest after I reread this is to first, determine what your list that you iterate through will be. On first thought, this is simply a copy of the table on-screen, however you need to be able to logically identify which record you are operating on. A clone collection is not ordered, so the first item in the collection isn't guaranteed to be the first row. Identify something within each row that allows you to find it again. This might be one of the columns in the row. It might also be something inside the HTML of the row that you can extract that uniquely identifies it. You must first locate that value and determine how to get to it.
After you can extract it, write an automation to iterate the clone collection and grab that value and add it to a lookup table. This is going to be the list that you iterate through.
Next, you will write what is effectively the inverse of the previous automation where you take one value from the lookup table as input and use that to locate the key for the row that you wish to operate on. With the key, you'll be able to perform an operation against a specific row.
Once you are comfortable with locating a given row, you can now put all these parts together into your automation to iterate and then return to the prior page and perform operations against the current row and the next row.
Shuurgan
CN
@ThomasSasnett Hello, Thomas. I saw what you mentioned here about reading rows and obtaining unique identifiers, but actually my webpage is different from other webpages. The 5 columns in the picture are separate. For general webpages, you can use target to obtain the entire row and then use different elements to determine which row it is in, and then use these different elements to click the checkBox of the row. This is how I understand it, but for this webpage, after I tried to target, I found that each column was independent. There was no way to identify an entire row. I could only target the checkBox and the parts covered by blue. Although it seems that each row has an independent number in the picture, because the whole cannot be targeted to a row, it is impossible to determine whether it is in the same row. Can I still use the method you mentioned? I am a little unsure about how to do it. If possible, can you use an automated program to simply simulate it? Thank you BAO
Pegasystems Inc.
US
@BAOX17175074 Would you mind interrogating the checkbox using "Select Element" from the interrogation form? Please include a screenshot showing the hierarchy of the control. Almost always, there is a container that contains each "row". This is what you'd interrogate as a container and set UseKeys to true on.
Shuurgan
CN
@ThomasSasnett Yes, I think there should be "rows" displayed in the hierarchical structure, but you can see that there are none here. There is only a checkbox that contains all elements. The size of "frmNyushukkin" is almost the same as the page "Nyushukkin2", so there is no way to use it. If you use target to select, you can only select the html that contains all row elements and other screen elements, so I think it is a bit troublesome. In the small picture below, the "All" property of the screen "Nyushukkin2" is actually used in the previous style book to generate the "webControlCollectionProxy" and the secondary "webControlProxy" determine whether it is equal to the siteName in the external folder to click to download and other operations. However, when I use the same web page, the control generated is "virtualHtmlCollectionProxy". Many methods and properties of this control and its sub-controls do not exist and cannot be used at all. Is there any way to change the properties of the generated control to make it a "webControlCollectionProxy"? Thank you BAO
Pegasystems Inc.
US
@BAOX17175074On the interrogation form is an option under the label "Drag capture icon over controls". Change that from "Default" to "Select element". This will show me the hierarchy of the page itself. What you are showing me is the hierarchy of what you have interrogated. Using this method of interrogation, you can specify exactly which control is the container.
Shuurgan
CN
@ThomasSasnett Hello Thomas. As shown in the figure, there is only one ta1 (table), but almost all elements of this Tabel are used, not just one row. In the default state, I can also directly intercept this table through target, and this is also the only table that can be intercepted within the minimum limit. BAO
Pegasystems Inc.
US
@BAOX17175074I am not sure what you are referring to in your statement. I do not understand what you mean.
"...but almost all elements of this Tabel are used, not just one row" - I do not understand
"In the default state, I can also directly intercept this table through target, and this is also the only table that can be intercepted within the minimum limit" - I do not understand
In this case, your checkbox appears beneath a table row (the TR tag on line 12). That is the element that should have use keys enabled. Inside of that row, there will be something you can use to logically locate it. That might be something as simple as a column (TR) within the row, or as complex as something within the InnerHtml of a particular cell or the row itself (or even the location property of the row itself perhaps). This is where you will need to understand how you would find it and code for that accordingly.
I am confident that this is something that our professional services can assist you with. I suggest contacting your account executive (or really any of your contacts with Pega) to retain some services should you require some hands-on assistance.
Accepted Solution
Updated: 18 Nov 2024 19:29 EST
Pegasystems Inc.
US
@BAOX17175074 Here is some documentation you might find helpful.