0

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?

1 Answer 1

1

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.

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

Comments

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.