18 Aug 2023 07:04 AM
Hi Folks,
For one of my Browser click-path monitor I want to validate if pdf generated successfully or not for last step.
When we click on generate a report and pdf generated in new tab. I'm trying to utilize the "Validate content" feature however, it keeps failing.
I'm using adding shadow DOM as DOM locater like below,
I have validated against developer console and it is giving me appropriate element that I'm looking for.
Can someone point out if I'm doing it wrong.
Regards,
AK
Solved! Go to Solution.
18 Aug 2023 08:32 AM
@AntonPineiro, thank you for the response.
I checked that thread previously but, I don't want to do any text validation on PDF. My requirement is to just validate if pdf is generated or not (because, sometimes it generate .doc instead of .pdf, I don't know how this is happening but that is what conveyed by our app developer :))
I tried to add JavaScript step at the end however, if pdf generation is failed (one of failure case) then monitor is not proceeding to additionally added JavaScript step.
Hence I want to add validation in the last step (click on "Generate report") itself which could check if pdf is generated or not.
Regards,
AK
18 Aug 2023 11:25 AM
Has anybody came across such requirement and done it successfully?
18 Aug 2023 11:43 AM
What error do you see when you use this validation? Or does it just not work?
You mentioned that if the pdf fails to generate then a JS event fails, so is there something you could check for that scenario in the validation? Do you see an error message etc?
18 Aug 2023 02:40 PM
And do you see that in all cases, whether or not the pdf is created or the new tab opened? It's interesting that it's the element that it says is not found rather than the window, so that does seem to point towards the window being there. Does it exist in a frame?
18 Aug 2023 03:14 PM
Hello @HannahM,
For this synthetics, I just seen one case where it fail to generate a pdf, never seen that generated report is in .doc.
It's app developer ask to whether document generated is .pdf or .doc.
How can I verify if it has any iFrame on new tab via developer console? can you guide.
From 'Element' section of dev console shows me that the required element is under shadow DOM and I'm able to successfully access it via below query and the same I added under validation.
Result in dev console for the same query. (I'm not using type attribute in monitor so that it will return whole element)
Regards,
AK
18 Aug 2023 03:40 PM
Usually Shadow DOM is used instead of frames but it could still be possible to have both. If you right click on the page where you want to validate, then you would see both view page source and view frame source by the Inspect option, if it's in a frame. If it is, you will need to add the correct frame to the window field.
23 Aug 2023 07:14 PM - edited 23 Aug 2023 07:15 PM
Hi,
I validated this by myself and with chat support as well.
As per their response, the recorder doesn't currently support shadow DOM. Shadow DOMs are completely isolated, so the agent has no access to them. A Shadow DOM doesn't have its own JavaScript runtime and is not accessible from outside.
I have added another DOM (not a shadow DOM) which is working perfectly fine for validation.
Thanks @AntonPineiro @HannahM for some useful guidance.
Regards,
AK