Rayrun
← Back to Discord Forum

Error CS0103: The name 'page' does not exist in the current context

confusedrediserposted in #help-playwright
Open in Discord
confusedrediser
confusedrediser

Hey Folks, I'm trying the NUnit sample code in the documentation and seeing the error in the title. My Playwright version is 1.35.0 on Windows Server 2019 and .NET 6.0 . Any ideas why this might be happening?

I also created a ticket in Github but this channel seems livelier so will remove/close that.

This thread is trying to answer question "Why am I seeing the error 'CS0103: The name 'page' does not exist in the current context' when trying the NUnit sample code in the Playwright documentation, and how can I define the viewport size and ignore HTTPS warnings?"

7 replies

Rename page -> Page lowercase -> Pascal Case

confusedrediser
confusedrediser

@mxschmitt Well, that was embarrassing for me and completely overlooked that. Thanks for your help. It's all working now.

confusedrediser
confusedrediser

On a related matter, if I want to define the view port size (window size) and ignore HTTPS warnings, how would I do that in the above sample code?

confusedrediser
confusedrediser

Thanks for that. I've added launch options including viewport size and ignore HTTPS errors. The test works as long as I don't use the Expect function. As soon as I add that, the error in my title reappears. Any guidance much appreciated.

confusedrediser
confusedrediser

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.