Relative Content

Tag Archive for type-conversion.net-8.0playwright-dotnet

How to convert from string to ILocator for Playwright

I’m making a C# Playwright test platform. I have a a list of strings I want to iterate through representing various locators on a page eg “GetByText(“foo”)”, or GetByRole(“AriaRole.Link, new() {Name=”bar”})”. I’d like to validate that each locator is present on my IPage, but I’m struggling with getting from string to ILocator for the assert step. Is there maybe a library out there that can perform this conversion, or will I have to write some bulky utility function to cover it?