Search code examples
captureblueprism

Capturing table elements in blueprism


I'm trying to capture a table element of a web application. This element is a search result. I want to browse through rows and select a particular row item from the searched results. Any helps please


Solution

  • I would use a concept of dynamic path to element here.

    That would be my approach to that problem:

    1. Spy a whole table using Application modeler
    2. Use "Read" stage to get a Path to that element. It can be for example

    "/HTML/BODY(1)/FORM(1)/DIV(3)/DIV(4)/TABLE(1)/TBODY(1)/TR(1)/TD(1)/DIV(1)/DIV(2)/DIV(2)/DIV(1)/DIV(3)/DIV(1)/DIV(1)/TABLE(1)"

    I'd store it in [Path_to_the_table] data item.

    1. Spy any element, and disable all attributes used to find it. I'd choose an attribute "path" and set it's "match type" to dynamic.
    2. Look into a path to the element that you want to use - in my example that's: /HTML/BODY(1)/FORM(1)/DIV(3)/DIV(4)/TABLE(1)/TBODY(1)/TR(1)/TD(1)/DIV(1)/DIV(2)/DIV(2)/DIV(1)/DIV(3)/DIV(1)/DIV(1)/TABLE(1)/TBODY(1)/TR(2)/TD(3)/UL(1)/LI(1)/IMG(1)"

    Please note, that the part to the table is exactly the same. The "TR(2)" part marked in bold says the row that the element resides.

    1. Make a data item, for example [Row_number], that says a row that you want to check.

    2. Make a new "read" stage, that tries to read a value from dynamic element from point 3.

    3. As a dynamic element I'd use a path from point 2, and a string from point 4. Please see example below:

    [Path_to_the_table]&"/TBODY(1)/TR("&[Row_number]&"2)/TD(3)/UL(1)/LI(1)/IMG(1)"

    That way i can read the value of the element, from the row that I choose.