Skip to content

Instantly share code, notes, and snippets.

@muditlambda
Created April 10, 2020 14:50

Revisions

  1. muditlambda created this gist Apr 10, 2020.
    5 changes: 5 additions & 0 deletions window.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    /*window.open() method for window handling in Selenium C# */
    js.ExecuteScript("window.open('" + test_url_2 + "', '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,width=800,height=800')");

    System.Threading.Thread.Sleep(6000);
    Assert.AreEqual(2, driver.WindowHandles.Count);