1

How to move to another URL without creating new istance of IwebDriver?
All I want is to stay on the same browser just close the current page and open the new one.

I have tried just to navigate driver to another page second time but it didn't work. Something like this:

Driver.Navigate().GoToUrl("http://www.outlook.com/");

Any suggestions?

1
  • Your code works for me. It loads in the same browser. But I'm using the same instance of DRIVER to accomplish that. Commented Aug 6, 2015 at 8:47

1 Answer 1

2

The following works:

driver.Url = "http://www.outlook.com";
driver.Navigate();

I have no idea why, but driver.Navigate().GoToUrl(...) does not work sometimes. In addition, you should have a IWebDriver instance anyway, and use it to navigate to sites (you only need one).

Sign up to request clarification or add additional context in comments.

3 Comments

I would like to know what is the reason for this working when is the same thing as Driver.Navigate().ToURL(); just in 2 steps.
@Mystia when you find out, let me know. This is just something that I've found to work over the past few years so I figured I'd save people the time by answering with it. It sounds like a bug in drivers. The vast majority of my work isn't selenium - I just play with it :)
Will let you know as soon as I find out , thank you for help anyway!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.