I am new to Windows Forms and my core competency is testing. I am trying to build a tool using Windows Forms where we can launch the webpage using webview2 and then record the steps which the user performs on the webpage as a string. These steps can be used as steps to reproduce a defect.
In order to do this, I created a Windows Forms project, added webview2 to the form, and hardcoded a URL in it.
In Form1.cs
I have added these methods:
private void webView2_Click(object sender, EventArgs e)
{
// logic to capture the clicked element on the webpage.
}
private void webView2_MouseClick(object sender, MouseEventArgs e)
{
// logic to capture the clicked element details on the webpage.
}
However, after launching the application and clicking on a webpage rendered using webview2, none of the above methods gets triggered.
I also tried using the Cefsharp library, which didn't help this cause.