Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 207

Return value from specific javascript function in Playwright

$
0
0

I need to extract value that was created after running some script. My tests are written in Playwright.

So, I have a javascript that return some id from locator on page. it looks like

cy.sdk.engine.block.findBy('image') 

This returns id of image. I've tested this script in devtools console and it works.

The question is, how to get this value to display in Playwright test results and verify if the script executed properly.

I'm trying this code:

await page.evaluate(()=> cy.sdk.engine.block.findBy('image'));

Playwright executes it but I don't see value that was created after executing script.


Viewing all articles
Browse latest Browse all 207


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>