Open a new tab in an existing browser session using Selenium

后端 未结 5 666
一个人的身影
一个人的身影 2020-12-28 21:01

My current code below in C# opens a window then navigates to the specified URL after a button click.

protected void onboardButton_Click(object sender, EventA         


        
5条回答
  •  时光说笑
    2020-12-28 21:29

    We can simulate Ctrl + Element Click

    Actions action = new Actions(_driver);
    action.KeyDown(Keys.Control).MoveToElement(body).Click().Perform();
    

    Reference:
    https://www.codeproject.com/Answers/1081051/Open-link-in-New-tab-using-Selenium-Csharp-for-chr#answer3

提交回复
热议问题