I have two sibling spans in my DIV. I am doing E2E testing in Blazor and I want to access the second Span content (@Status
).
<div>
<span> Status:</span>
<span> @Status</span>
</div>
I found a solution for it, if it was JavaScript according to this link.
const text = await page.locator(':text(" Status:") + span').textContent();
However, I am not sure how to do the same for C# syntax. I have access to the first span but not next one.
var firstSpan = Page.Locator("text= Status :");