Skip to main content
Kofax

How to extract from an optional HTML attribute in CEF?

Article # 3045707 - Page views: 4

Issue

How to extract from an optional HTML attribute in CEF?

 

Solution

First approach (Finders)

There are ways to write finder containing more than one element in a selector. If you have an element with an optional class element, probably the parent of this element has an attribute which you can use to find your element. See the following links for more details on how to write a robust selector:

https://docshield.kofax.com/RPA/en_US/11.2.0_ea1ydbmwk9/help/rpa_help/kap_help/designstudio/c_guardsandfinders.html

https://docshield.kofax.com/RPA/en_US/11.2.0_ea1ydbmwk9/help/rpa_help/kap_help/designstudio/c_copycomponent_selector.html?h=selector

 

Second approach (Location Found)

[Location found guarded choice for component X],

Then inside the guarded branch another guarded choice, with two complementary branches:

[Location found for component X[class], then inside the branch an Extract class step to variable Y]
[Location not found for component X[class], then inside the branch an Assign Y = ""]

 

Third approach (Try-Catch)

If none of the above works, the try-catch that catches ExtractIssue would be a possible workaround. 

 

Level of Complexity 

Easy

 

Applies to  

Product Version Build Environment Hardware
Robotic Process Automation All versions      

References

Add any references to other internal or external articles

 

 

Article # 3045707