cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Validate content for step using DOM in Browser click-path monitor

AK
Pro

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,

AK_0-1692338114614.png

I have validated against developer console and it is giving me appropriate element that I'm looking for.

AK_0-1692338498261.png

Can someone point out if I'm doing it wrong.

Regards,

AK

9 REPLIES 9

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

Maybe this tip would be helpful.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

@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

 

 

AK
Pro

Has anybody came across such requirement and done it successfully?

HannahM
Dynatrace Leader
Dynatrace Leader

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? 

 

Synthetic SME and community advocate.

@HannahM , thanks for the response.

I'm getting below error.

AK_0-1692365607921.png

Regards,

AK

 

HannahM
Dynatrace Leader
Dynatrace Leader

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?

Synthetic SME and community advocate.

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.

AK_1-1692367385418.png

Result in dev console for the same query. (I'm not using type attribute in monitor so that it will return whole element)

AK_2-1692367655901.png

Regards,

AK

 

HannahM
Dynatrace Leader
Dynatrace Leader

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. 

Synthetic SME and community advocate.

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

 

Featured Posts