Dynamic Attribute, with Wildcards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-07-19 12:46 PM
Hi all,
I am currently building an integration where the usage of Dynamic Attributes with wildcards would be a huge help.
Is there any way to achieve this?
For example:
The Window Text of a specific window can be:
"Create - Customer", "Create - Product", "Modify - Customer", "Modify - Product" and so on.
If I could provide "Create*" or "Modify*", through the Dynamic input, that would solve the issue - But I cant seem to find a way to trigger the wildcard search, through the dynamic input.
I do have other solutions in mind, but this would be the easiest and cleanest, if possible.
------------------------------
Michael Berg Andreasen
RPA Developer
SE
Europe/Denmark
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-10-22 04:49 PM
Thank you for the reply .
I am attaching you the rows which I should catch(There may be one 1 row ,3,9 rows etc . )
Below I am attaching you the screenshots of "Inspect elements" for some rows.
------------------------------
Erjola Mema
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-10-22 05:42 PM
Before that was a truly viable option in the platform, I had previously written some other automations that would loop upward through a range of div indices until it found a matching container, then used that as an offset going forward.
For example.
Path (dynamic): HTML(1)/BODY(1)/DIV(3)/DIV(2)/DIV([count])/TABLE(1)
Logic:
- Use a wait stage with a 0.1s timeout to run a Check Exists against the dynamic element
- Timeout
- [count] = [count]+1
- Return to wait stage to retry
- Element found
- Proceed with process
- Timeout
------------------------------
Ami Barrett
Solution Architect
Karsun Solutions
Plano TX
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-10-22 01:31 AM
Hi @ErjolaMema,
If you can also show the table tag above, it that would be helpful. From what you showed me, seems like you have a table, and you want to catch the values within each of the td tag corresponding to the cells of different rows but for the same column.
Problem Statement:
In my example, let's say I have a requirement where I need to extract only the cell value for each of the cells in the first column which is called as 'Name' as shown below:
In your case you too have a similar requirement where you want to extract the values for each cell with the column header as 'Conto'
Solution Explanation:
If, you see the HTML structure, on a very high level, we have a table tag with an id attribute called as 'example' which consists of a thead and a tbody section as shown below:
Now if I see thead section, it has all my header cells denoted within separate th tag here:
And similarly, my tbody tag will have different rows denoted by tr tag within which each cell will be denoted by td tag:
So the XPath Expression that I am going to build for this use case would be something like this: //table[@id='example']//tbody/tr[1]/td[1]
What it means essentially in layman's term is go the table tag with the id attribute as 'example' first. Once you find it, go inside the table for the tbody tag and within that aim for row number 1 which denoted by tr[1] and column number 1 which is denoted by td[1]
This XPath would always aim to 1st row and 1 column value as shown below:
Now if let say I want to make it a bit more robust such as I give the name of the column and it automatically provides the value irrespective of the position of the column, my tweaked XPath expression would become: //table[@id='example']//tbody/tr[1]/td[count(//table/thead/tr/th[.="Name"]/preceding-sibling::th)+1]
Here instead of td[1] I wrote td[count(//table/thead/tr/th[.="Name"]/preceding-sibling::th)+1]
which means find one position ahead of the position of the td tag which corresponds to the column defined just before the column having the header title as 'Name' within the thead section of the table.
What this does is it makes your XPath expression dynamic, and it won't rely on column position. Now to finally complete our XPath query we would make the expression dynamic in such a way that we can keep looping a counter variable within it for the tr tag as we are right now pointing the expression to first row using tr[1].
So, we make the attribute dynamic in nature and we use the following expression in a read stage:
The final expression becomes:
"//table[@id='example']//tbody/tr["& [row counter] &"]/td[count(//table/thead/tr/th[.=""Name""]/preceding-sibling::th)+1]"
Final Solution:
So you can use the following modified final expression which I have simplified even further than what I used for my explanation. The only condition is that your table must have a th tag with the name as 'Conto' and a data item called row counter which start from 1 and keeps incrementing till it encounters an error to exit:
"//table[@id='example']//tr["& [row counter] &"]/td[count(//table//th[.=""Conto""]/preceding-sibling::th)+1]"
Also, the best thing about this is if you are able to provide an attribute to the table tag which is 'id' in my case then you probably don't even need to worry about the DIV tags behind it as it will straightaway search from table table ignoring the DIV tag values which you were facing initially.
NOTE: Remember to change the table id tag here from example to what you have. If you don't have id attribute look for a unique attribute and replace both id attribute with that and its value as well
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-22 09:16 AM
Hi Devneet ,
Thank you very much for the reply.
Attached is the table :
So, What do I have to put in the 'Id' ?
Is there a change that I should do ?
------------------------------
Erjola Mema
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-22 09:36 AM
Hi Devneet ,
The other thing is that I have it only Web Path ,not also the X Path .
Is it a problem?
------------------------------
Erjola Mema
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-22 09:38 AM
Hi @AmiBarrett,
I don't have the Xpath in it .
Is there any other way for a solution ?
------------------------------
Erjola Mema
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-22 11:17 AM
You have to provide the XPath expression in that Web Path attribute only. It accepts both XPaths and full path expressions.
Also, can you show me the HTML for the <table> tag by using inspect element as you did before for <td> tag.
It is impossible to say what the ID would be as you have only shown the screenshot of the table not the HTML code behind it.
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-22 11:28 AM
Source of below snapshot -
https://blue-prism.docebosaas.com/learn/course/16924/play/37103/Spying%2BUsing%2BCSS%2BSelector%2Band%2BXPath%2B%25E2%2580%2593%2BBasics
------------------------------
Neeraj Kumar
Technical Architect
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-10-22 05:25 PM
------------------------------
Ami Barrett
Solution Architect
Karsun Solutions
Plano TX
------------------------------

- « Previous
-
- 1
- 2
- Next »