Rayrun
← Back to Discord Forum

or condition not working in playwright node.js

await expect(locator1.or(locator2)).toBeVisible();

Getting TypeError: locator.or is not a function

rn_image_picker_lib_temp_af72ec21-76a6-4745-b2fd-d3d259609a62.jpg

This thread is trying to answer question "Why is the 'or' condition not working in Playwright node.js and how can it be fixed?"

4 replies

wouldn't it be more something like: await expect(locator1.toBeVisible || locator2.toBeVisible)

vertigo448
vertigo448

What playwright version do You have @RG ? Or was added in 1.33

I have version 1.30 and updated it to the latest now it's working fine.

vertigo448
vertigo448

👍🏻

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.