Question
Deloitte Consulting
US
Last activity: 28 Jun 2017 22:36 EDT
HTML Table DataCell gets unmatched upon an event
Hi,
I interrogated a table on a webpage using HTML table designer. I am able to extract data from cells using for loop with out any issues.If the data cell text matches a specific string, I am trying to select the row and remove it from the table. On the next iteration of for loop, the data cells are not getting matched and the automation is breaking. I tried table rematch and that did not work. Any suggestions ?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Bank of America
Hi,
I ended up making some tweaks to the matchrules of DOMTable. Removing TableSection (as the count of number of rows on the table changes everytime a row gets selected) from the control children match rule and doing a DOMTable refresh fixed my problem.
Thanks all for your suggestions !
ANZ
IN
Hi,
Are you passing index value to the cell property?
Deloitte Consulting
US
Yes, I am passing index to the cell property.
Pegasystems Inc.
US
If you are iterating a collection and that collection changes (or in this case goes away entirely), then you'll need to change the collection outside of an iteration. I am assuming that by remove a row, you click some sort of button on that row that causes the table to get recreated without that row. If that is not the case, please correct me.
- Iterate your table locating the specific row that you need to click on.
- Record the Index of this row to a variable and break your loop.
- Off of the break execution path for your loop, click the button to delete the row.
- I would trigger this click off of the setup execution path for a WaitForDestroyed for the table as changing the table will cause it to rematch.
- Once the destroyed event fires, you may wait for the table to be created again and proceed.
Deloitte Consulting
US
Hi,
I tried above solution. If the value of a cell in a particular row of table matches a string (there can be multiple rows), the row has to be selected and deleted. The delete event happens upon a button click and the button is outside of the table. I did a for loop break , captured row index and selected the row and called button performclick .Outside of for loop, I created a button click event and tried to rematch table and look for reminder rows that matches. This is not matching cell controls. Any alternate way to do this ? Your time is much appreciated.
Thanks !
Pegasystems Inc.
US
Are you saying that after you delete a row, then your table no longer matches? If so, you'll need to interrogate the "new" table after the delete and see what is different about it from your current one as there is no real matching troubleshooting for an HTML table.
Can you post screenshots pre and post delete of the table and include screenshots of your HTML table designer? I can try to look at those to assist. That may help, but I don't believe this can be solved simply via a forum, so you may need to open an SR to get some live assistance.
Deloitte Consulting
US
Hi,
Please see the attached file. I have a for loop that loops through each row in the table. If cell( "SR Request Type") matches a particular string in the table - "Transfer to me" button needs to be clicked followed by a "Refresh" button click. Upon clicking "Transfer to me" button, the rows that has above matching cell gets deleted from the table and the table is getting unmatched. Any thoughts on what can be done to rematch the table.
Thanks,
Harika.
Pegasystems Inc.
US
When you click transfer to me, you are likely destroying and then recreating the table. You'd need to break out of your loop and restart it after waiting for the table to get recreated (wait for the destroyed event when you PerformClick on Transfer to me followed by a wait for create on the table). You'd then restart your loop starting at the first row and going through the end looking for more matching rows.
Deloitte Consulting
US
Hi, I tried implementing the solution you suggested. Please look the screenshot attached. The SR_Type cell is not getting matched.
Pegasystems Inc.
US
It's really hard to see what is going on there with all the crossing lines. I suspect that because your table is underneath something that is cloned, that you are supplying the wrong key to it (you are using None). Can you confirm that during interrogation, the table matches after you click "transfer to me"?
Bank of America
Hi, Sorry for the late reply. The table matches after clicking "Transfer to Me". However, the cells underneath table section no longer matches after " Transfer to Me"
Bank of America
Hi, Sorry for the late reply. The table matches after clicking "Transfer to Me". However, the cells underneath table section no longer matches after " Transfer to Me"
Pegasystems Inc.
US
You need to investigate why they are not matching within your table. Perhaps the format is changing. You can try the following;
1. Change or add a new match rule so that your table doesn't match at all.
2. Navigate to the table and transfer a record.
3. Now interrogate the table as a new one.
This may help you compare what is different about them so you can adjust the matching for the real table accordingly.
Anthem
US
Hello Harika,
I would recommend you try with below two things.
1. Adding more wait time for WaitForCreate.
2. Try to Rematch the control recursively (twice, thrice) till it get matched.
domTable1 - WaitForCreate - configure it for 1 minute (60000) and if WaitForCreate returns false, use Rematch recursively till it get matched. As the page refreshed once the "Refresh" button clicked, the controls to be rematched.
Regards,
Kannan
Accepted Solution
Bank of America
Hi,
I ended up making some tweaks to the matchrules of DOMTable. Removing TableSection (as the count of number of rows on the table changes everytime a row gets selected) from the control children match rule and doing a DOMTable refresh fixed my problem.
Thanks all for your suggestions !