Gaurav Arora
Gaurav Arora

Reputation: 1

Getting webdriver exception: unknown error: unhandled inspector error...cannot navigate to URL

I am using:

driver.get(“www.google.com”) 

The script is not running from this line of code

And if i use:

driver.get(“https://www.google.com”) 

It start working

Can anybody please help me out why it is working with https and not working without https?

Upvotes: 0

Views: 260

Answers (1)

Ishita Shah
Ishita Shah

Reputation: 4035

It is inbuilt implementation of Method get(); and navigate().to(); which work on HTTP GET request.

This is Declaration By method itself:

Load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete. This will follow redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until this timeout is over, since should the underlying page change whilst your test is executing the results of future calls against this interface will be against the freshly loaded page.

Parameters: url The URL to load. It is best to use a fully qualified URL

However When we use same string in Browser and it works. Because Browser has it default HTTP protocol and based on that if we don't text http:// or https:// it automatically convert String in to URL.

Here transformation made via get(); method to Browser, and As declared by method it needs URL and not String. Thus it retrieve this Exception.

Upvotes: 1

Related Questions