How to return dataLayer object in Selenium IDE?

38 Views Asked by At

I have a problem with getting a dataLayer object using a test in selenium ide. I'm trying to use ide to set the command to execute a script with the "return window.dataLayer" parameter and and assign it to a variable. Then I try to display a message with the content of the variable in the console (ide), but I get undefined.

enter image description here

I expect to echo dataLayer object in selenium IDE console.

I try to run same test (exported from selenium ide) in pytest - it is working, and I see the dataLayer.

Although in the development tools in the same browser I can get the object through the console by typing dataLayer or window.dataLayer.

enter image description here

0

There are 0 best solutions below