What error does this line return when I pass a URL without HTTPS or HTTP
It was asked to a fresher in his interview.
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.Sign up to join this community
I think it is a stupid question to ask in an interview, because it asks a very specific detail of how to use WebDriver that I have not really thought about in the 10 years I am using Selenium, but this might a great answer:
I have just tried removing HTTPS with WebDriver C#, but it uses
driver.Navigate().GoToUrl(), it gives:
Message: OpenQA.Selenium.WebDriverException : invalid argument
(Session info: chrome=77.0.3865.120)
I think it might be different depending on language and or browser driver implementation.
There might be a risk that leaving out the HTTPS it could default to HTTP, thus not testing the HTTPS version of the site. I do think HTTP should always redirect to HTTPS and you should only test one version.