microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.41k stars 3.63k forks source link

How can I make PlayWright (DotNet) to wait until it finds an element without timing out, until the control appears? #14668

Closed vigsubramani closed 2 years ago

vigsubramani commented 2 years ago

I was trying to wait for a control on a web page, which is taking large time (Approx 1 to 1.5 minutes) to load. But, PlayWright gets timed out and not waiting until the control gets loaded. Can you please help us to provide the knowledge on how to wait for a control to load to proceed to next step? Also, can you please help us understand on how to wait for a text / control to appear, so that we can assert that the transaction is successful.

Is there a possibility to introduce AutoWait without timeout for these 2 requirements?

pavelfeldman commented 2 years ago

@gauravgandhi1315 that's a very bad advise.

@vigsubramani every Playwright action (ClickAsync, WaitForAsync, etc) has a timeout option. Pass large value or 0 to disable timeout.

gauravgandhi1315 commented 2 years ago

@pavelfeldman Sorry my bad, you are right!

pavelfeldman commented 2 years ago

Closing as per above, please feel free to open a new issue if this does not cover your use case.