cancel
Showing results for 
Search instead for 
Did you mean: 

Variable path during spying

SunilHarikaran_
Level 3
Hi, I have to spy an element of webpage, but the path is variable. Say path is TABLE(1)/TBODY)/TR( x )/TD(1)/TABLE(1)/TBODY)/TR(1)/TD(1)/ The value of x varies from 0-9. How can i implement it?
5 REPLIES 5

Ravindersaini
Level 7
Hi, Try keeping the value of variable attribute as ""Dynamic"" and pass the required value. Regards, Ravinder Saini

John__Carter
Staff
Staff
Use a calculation to set a data item called Path, eg ""TABLE(1)/TBODY)/TR("" & [Row Number] & "")/TD(1)/TABLE(1)/TBODY)/TR(1)/TD(1)/""Then as Ravi says, inject the path value from the diagram into the dynamic attribute. See page 14 in https://portal.blueprism.com/system/files/Browser%20Automation%20Guide.pdf

SunilHarikaran_
Level 3
Thanks a lot. I missed on this logic.

BuzzaT
Level 4
I wanted to offer an alternative solution that we use here in house: We replace the variable with a throw away character for instance: [txt_Path] = TABLE(1)/TBODY)/TR(@)/TD(1)/TABLE(1)/TBODY)/TR(1)/TD(1) And just call a Replace on that character. This lets you contain the dynamic path in one variable no matter how many dynamic parts there are to it, instead of having to split it up a bunch. For your Dynamic Path element: Equal = Replace([txt_Path],""@"",[num_Index])

Thankx for your input John. Unfortunately, it doesn't work on my side. I got this message ""Internal : Error - Highlighting results - Failed to parse the path"" when I write this in the Application Modeller /Attributes: /HTML/BODY(1)/IFRAME(2)/HTML/BODY(1)/FORM(1)/DIV(8)/DIV(1)/DIV(1)/TABLE(1)/TBODY(1)/TR("" & [Counter] & "")/TD(2)/A(1). Did you write the path the same way?