You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Playwright;
using Microsoft.Playwright.NUnit;
using NUnit.Framework;
namespace PlaywrightTests;
[Parallelizable(ParallelScope.Self)]
[TestFixture]
public class Tests : PageTest
{
[Test]
public async Task HomepageHasPlaywrightInTitleAndGetStartedLinkLinkingtoTheIntroPage()
{
await Page.GotoAsync("https://playwright.dev");
// Expect a title "to contain" a substring.
await Expect(Page).ToHaveTitleAsync(new Regex("Playwright"));
// create a locator
var getStarted = Page.GetByRole(AriaRole.Link, new() { Name = "Get started" });
// Expect an attribute "to be strictly equal" to the value.
await Expect(getStarted).ToHaveAttributeAsync("href", "/docs/intro");
// Click the get started link.
await getStarted.ClickAsync();
// Expects page to have a heading with the name of Installation.
await Expect(page
.GetByRole(AriaRole.Heading, new() { Name = "Installation" }))
.ToBeVisibleAsync();
}
}
Steps
dotnet test --settings PlaywrightTests.runsettings
error CS0103: The name 'page' does not exist in the current context
The text was updated successfully, but these errors were encountered:
marketier
changed the title
[BUG] Error CS0103: The name 'page' does not exist in the current context using sample from documentation
[BUG] Error CS0103: The name 'page' does not exist in the current context using sample code in documentation
Oct 31, 2023
System info
Source code
The code is from the documentation.
Steps
Expected
Chromium browser to launch and test to run for https://playwright.dev
Actual
The following error is reported:
error CS0103: The name 'page' does not exist in the current context
The text was updated successfully, but these errors were encountered: