I am trying to automate web based application (asp.net) through selenium web driver.
Web application has login page and once I log in, I need to click on a button that opens a new window and then perform operations on this new window. So far, my code is able to login and click the button. Two problems here:
- instead of opening desired window on click, it opens the login page
- this login page is opened in the same window, not new one
I have used below statement to switch to new window:
webDriver.SwitchTo().Window("newwindowname");
Have you tried to use the window handle?
Get the window handles
And use the last one in the swtichTo statement