2

Every time I try to use Wildcards (*) to dynamically refer to HTML element I receive exeption:

Error - Highlighting results - Exception has been thrown by the target of an invocation.

In attached example I'm trying to find Input, using dynamic path:

/HTML/BODY(1)/FORM(1)/DIV(1)/DIV(2)/DIV(4)/DIV(1)/DIV(1)/DIV(3)/DIV(1)/DIV(1)/DIV(1)/*/INPUT(1)

Where full path:

/HTML/BODY(1)/FORM(1)/DIV(1)/DIV(2)/DIV(4)/DIV(1)/DIV(1)/DIV(3)/DIV(1)/DIV(1)/DIV(1)//DIV/INPUT(1)
                                                                                     ^^^^

Anyone have any experience with that? Is it some internal bug, or it's just not possible?

enter image description here

To make a long story short: I'm building flexible object, which will work with different page structure. Let's say one example of path to object is:

A/B/C/D/E/Input(1)

and the other time it's:

A/B/C/E/F/Input(1)

Common path element is always:

A/B/C

AND:

Input(1)

Middle of path is flexible, so in one scenario could be:

A/B/C/F/H/X/Z/Input(1)

That's why I though about solution to refer to those input elements dynamically, using:

A/B/C/*/Input(1)

But for some reason it gives me error. I'm using Match Index = 1, so it should always first found object, but it gives exception, instead.

Michał Plich
  • 175
  • 4
  • 15
  • 1
    I have edited your question a little. Please check if everything is still good. I am not able to reproduce the issue you are experiencing however. it might be that there are too many html elements on the page you are working on? (just a guess). Maybe you might want to try using reg ex instead, but you'll need to know what exactly can be in that `/DIV` you are making dynamic there to ensure it works well. – Jerry Jan 30 '19 at 11:16
  • I've edited original post, and added explanation, which may shed some more light on that – Michał Plich Jan 30 '19 at 11:56
  • What BP version do you have? – Marek Stejskal Jan 30 '19 at 16:02
  • Version of BP is 5.0.23 – Michał Plich Jan 31 '19 at 14:55
  • 2
    That is pretty old :x the latest release is 6.4.1 – Jerry Feb 02 '19 at 16:04
  • Can you upgrade to 6+ or do you have to keep using 5? The reason I'm asking is because 6.3+ has the path functionality much better. I was never able to get the standard DOM path working reliably with wildcards. – Marek Stejskal Feb 05 '19 at 09:22
  • There will be a global update soon, then I'll let you know whether it helped. My temporary solution is adding one more "Equal" Attribute to Application Modeller, E.g. Width = 401. (But Width > 400 returns the same exception) – Michał Plich Feb 06 '19 at 07:57

2 Answers2

0

so this isn't an easy thing to debug or assist with as the issue you are encountering could be a Blue Prism issue but it also could be an underlying target application issue. So i'll step through what's going on but ask you for more info if you wish to re-submit the question for more help. The further things we need are the about information on yoru Blue Prism set up i.e. version number, app modeler version .net version etc. Then also information about the underlying system, is it chrome/IE etc is is a javascript site or a bootstrap site is it dynamic in any way etc.

Now to explain the error and go through possible reasons it's happening.

 Exception has been thrown by the target of an invocation

This piece of text means is some thread is running some code asynchronously and somewhere the async'd execution has failed and the exception has popped up into the main code. i.e. the target invocation is causing the issue. Typically in real world programming you would wrap some more exception handling around these components that are executing to catch the error and produce a stack trace to debug however that doesn't exist in Blue Prism for us when running it as we do. Likely what is happening is the Application modeler is attempting to connect to the target application, while connected it then attempts to perform some sort of parse of the xml tree structure using wildcards and then fails while executing this call. this call happens asynchronously and fails and the error bubbles all the way back into the main Blue Prism application (if you are not aware the app modeler and BP are two seperate apps that speak to each other.) The exact breakdown of this issue is unclear but I believe a wildcard search bug exists in the the app modeler currently for certain web browsers and has existed since late It has also known to happen for dynamic attributes in some instances as well though those were resolved in 6.4 I believe as of release notes.

The other possibility of what's happening is you have connected to the wrong child instance of the application and though Blue Prism acts like it can see and highlight all these elements on screen when you go to interact with some of them they fail spectacularly. Detach from this running instance of the application then re-attach using different attach criteria in your navigate stage performing the attach, adjusting the child index value. You can start at 0 and go up in increments of 1 to say 2 or 3 then attempt the spy again when the attach connects successfully. These are the only known methods I know of to circumvent the issue you are encountering hope this helps you understand what's happening and possibly resolve your issue.

Dexter Whelan
  • 414
  • 3
  • 15
-1

I suppose there is several inputs in the page ? This cause this problem because you put a wildcard for the div and ask for the input(1). But there is several of input(1) depending of the div.

Example :

DIV(1)/DIV(1)/DIV(2)/INPUT(1)

DIV(1)/DIV(1)/DIV(3)/INPUT(1)

There are INPUT(1) from the DIV(2) and a INPUT(1) from the DIV(3).

Putting a wildcard there call for multiples INPUT and can't work.

Ice Ax
  • 152
  • 1
  • 10
  • It cannot work, but the error would be different; i.e. something along the lines of "more than one element was found matching the criteria!" will be obtained instead of the error the OP is getting. – Jerry Feb 06 '19 at 06:41
  • Hi Jerry, I'm not suggesting anything here, just saying that OP's solution won't work. If the HTML code is done good, he can try by identifying by the INPUT ID. – Ice Ax Feb 06 '19 at 08:35
  • You were actually suggesting 2 additional things in your answer: first that the OP has several INPUT in their webpage and second that they are trying to spy multiple INPUT from that webpage. I'm saying that if that was the case, the error message would be different – Jerry Feb 06 '19 at 08:44
  • It would be if the "Match Index" and "Tag Name" attributes weren't checked. I simulated this on my side and got the same error as OP did. But If I uncheck "Match Index", indeed I get the error you're talking about. – Ice Ax Feb 06 '19 at 09:04