Unable to identify HTML element | Two IE windows

composedgaurav

New Member
Hey guys, this issue is driving me mad and I will try to explain in detail.

I have an Object A, which is opening an IE window with a URL and getting some text for which hash needs to be calculated.

I have an Object B, which is basically opening an IE window with a URL, putting some text (one I got from Object A) in the text box, clicking a button to calculate hash of the text and then hash is displayed on the webpage, so it reads the hash value. This works perfectly when I run it from the object studio by manually setting the text value for which hash needs to be calculated. The hash result element is identified without any issues.

Now, I have a Process A, which first calls Object A and gets the text for which hash needs to be calculated and keeps IE running as I need to come back to it later. It then calls Object B passing the text as argument for which hash needs to be calculated. Object B successfully launches IE, puts the text in the text box, clicks the calculate hash button but then fails to identify the hash result element.

Could it be because IE in Object A is still running? Both Object A and B have been modeled so they will launch separate IE windows. Will appreciate your inputs!
 
Last edited:

VJR

Well-Known Member
Hi composedgaurav,

Can you confirm my understanding of the flow and the question below?

Object A: opens URL in IE -> puts a text say MyTextObjA in the textbox -> clicks a button - displays its hash result element on the webpage -> correctly identifies its hash result element.

Object B: opens URL in IE -> gets some text (say MyTextObjB) for which its hash value needs to be calculate by Object A

Process A:
1) Calls Object B -> correctly gets the MyTextObjB -> keeps IE running.
2) Then Calls Object A -> passes MyTextObjB to Object A -> Now Object A tries to insert this MyTextObjB into the Object A textbox (which is nothing but MyTextObjA now).

You mentioned - "The Object B fails as it's unable to identify the hash result element."

Trying to understand why did you mention Object B is failing whereas it is Object A that is doing the job of identifying the hash result element?
 

VJR

Well-Known Member
If its a typo and you wanted to mentioned Object A then try adding a long wait after Process A calls Object B and before its calls Object A.
 

composedgaurav

New Member
Hi @VJR, thanks for taking the time to reply to my question. I have corrected all my typos and re-structured the naming convention in my original post. Could you please read my question now if you don't mind? I will implement the long wait between calling of processes and let you know how it goes. Could you tell me why is the wait needed though?
 

VJR

Well-Known Member
Hi composedgaurav, usually if something works in the Object Studio but not during the Process then a Wait stage is added to be properly identified by BP. Try and see what happens. This time, after your modifications in the original post, you need to add a wait just after the clicking of button and before identifying the hash result element. This wait that you are going to add should be a dynamic wait which waits for the specified number of seconds till the hash result element appears on the page.
Also what is it that you are referring as the Object fails? Are you getting an error message? If so what is that message trying to say?
 

composedgaurav

New Member
Well, the same Object works when I run it from the Studio without the Wait stage after clicking the calculate hash button and before attempting to read the result displayed on the same web page but I will implement this Wait and let you know.

The Object fails stating that it's unable to identify the "Hash Result" element. It's really weird because it works absolutely fine while modelling the application and also when I run the Object separately, just not when it's called from another Process, which is why I thought it could have something to do with the IE which is also running due to the first Object.

Also, the page I am talking about is http://www.sha1-online.com/
 

VJR

Well-Known Member
"the same Object works when I run it from the Studio without the Wait stage "
That's the exact reason why Blue Prism themselves have mentioned to make use of the Wait stage.

If the dynamic wait does not work then from the error message it looks like you will need to modify the attributes of the Application Modeller. The number of attributes need to be minimal for BP to properly identify. Play around by changing the 'Matching' attributes. Again something that Blue Prism has been trying to convey again and again about using the Application Modeller.
 

composedgaurav

New Member
Believe me I have tried numerous attributes' combination and it always succeeds when it's running as a single Object but fails when the same Object is called from another Process/Object. If it was the case of attributes selection, I would have posted with the correct description.
 

VJR

Well-Known Member
Hi composedgaurav, I've added a dynamic wait and tried calling the object from a process and its working perfectly fine. Try adding the wait at the above mentioned location.
 

composedgaurav

New Member
Hey, I implemented the Dynamic Wait like you suggested but it's still not working. The wait times out after 10 seconds trying to check whether the hash result element exists. However, it works if I run it as a single Object. Did you simply call the Object to calculate hash or got the text of which hash should be calculated from another webpage by calling the first Object? I am using BP v5.0.10.0
 

composedgaurav

New Member
@VJR It worked! The problem was that in my hash calculation Object, start and end stage was not connected in the "clean up" page. Totally unrelated but that's what it was.
 

VJR

Well-Known Member
Aaah!, something to keep an eye on the top 'Errors' button which increases the count when the stages are not linked ... ;)
 
Top