Rayrun
← Back to Discord Forum

shopify widget not visible

kosmocramerposted in #help-playwright
Open in Discord

Hey guys, I’m trying to a run a test where a widget is shown on the browser. When I try to run the script, the widget is getting blocked by default on chromium browser and I can’t use .isVisible() method to check thi. Is there any other way ?

This thread is trying to answer question "Is there a way to check the visibility of a widget on a chromium browser when running automated tests?"

7 replies
refactoreric

Hi, what do you mean with 'is getting blocked'? Do you see any error, which one exactly? Or what other symptom indicates to you that it's getting blocked?

And does it work as expected on a regular (non-Playwright) Chromium or Chrome browser?

If it's unclear to you what exactly is happening, have you tried recording a trace? https://playwright.dev/docs/trace-viewer-intro

Hi @refactoreric , I'm trying to locate this element which shows up as a small widget on the bottom right when browsing normally. This doesn't show up while running automated tests and I'm using .isVisisble() method to assert but it's failing since it can't find the element. However if I click on inspect element, the source is there. How can I verify this?

image.png

here's the code I'm trying

image.png

shopify widget not visible

If you can identify the network call that loads this element, you can then wait for that request to return a success response. That way when you check for visibility, if the element has actually loaded your check will pass. If the network call doesn’t return a success response then throw an error before checking for visibility.

refactoreric

Also you can consider to use the auto-retrying assertions. They are intended for these kind of things. Pages that aren't immediately ready after loading. Nowadays many things load progressively even after the load event of the main page was emitted. https://playwright.dev/docs/test-assertions#auto-retrying-assertions

@refactoreric: yes I tried this, and it worked. Thanks alot <:AUIsadhug:817790852365680670>

yes I tried this, and it worked. Thanks alot <:AUIsadhug:817790852365680670>

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.