cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic HTML Path

shahariar_k_bhu
Level 5
Hello, Question about dynamic HTML paths. I have this Internet Explorer page with various folders, and inside these folders, there are some other icons you can click at. I need to navigate between these folders. The problem is that sometimes, there can be many folders, sorted in different ways. For example, I have these folders: Folder A Folder C I need to navigate from inside Folder A to Folder C. However, sometimes, a Folder B can be added. Folder A Folder B Folder C Folder B will then have the previous path of Folder C, so whenever inspecting, Folder B will be chosen. That's why I've tried using dynamic paths. The way I use dynamic paths: I have copied the HTML path from a folder. It can look like this: "/HTML/BODY(1)/DIV(1)/DIV(1)/DIV(4)/DIV(2)/DIV(1)/DIV(2)/DIV(" & [Counter] &")/A(1)/SPAN(1)" 1. I use a calculation stage to set the path to a Data Item called Path. 2. I read the Value (identify the folders using their name) using Path as dynamic attribute. Read stage is used. 3. Around the Read stage, I hafve a block in which throws an Exception if I don't get any values. If exception is thrown, increase the counter. 4. If a value is returned, and it's the target value, then we click on it. The problem: Step 3, throwing Exceptions takes too long. I tried to navigate between two folders, this took me around 1 minute. Even surface automation could do it faster. Is there any ways I could improve the navigation between folders using dynamic paths?
2 REPLIES 2

shahariar_k_bhu
Level 5
I actually went from using HTML to use the ID, as the ID of the folder is like this: folderLink_0, folderLink_1 etc. However, it still takes me ~50 seconds to move from the inside of a folder, to the inside of another. So yeah, it's not any better. The main problem is actually catching the exception, that's taking too long. If ID is wrong, then it will use at least 30 seconds to catch the error (i have a block around read stage with a resume block inside to catch the exception). Anyways, how can improve the speed of this step? Is this the raw HTML you want? Dimension How do I use RegEx to find the HTML value, and then compose the path?

shahariar_k_bhu
Level 5
Hey, I just wanted to say that instead of using a read stage on step 2, I use Timeout to see if the element with the dynamic exists or not. I am not sure why I didn't think of using a timeout stage earlier. With a timer of 0.5 secs, I am able to find the element very fast.