I\'ve created a Maven project with 20 tests made with Selenium Webdriver (java). Now, when I want to execute my Maven project, I get sometimes the following error:
M
Here is the Answer to your Question:
Not Secure
then whenever you access the URL through Mozilla Firefox 53.0, Firefox will display a lock icon with red strike-through red strikethrough icon in the address bar. Now when URL gets loaded the cursor by default will be positioned on Username
field and there will be popup showing a message This connection is not secure. Logins entered here could be compromised. Learn More
like this:Username
input field and the Not Secure
popup overlays the Password
input field.click()
or sendKeys()
operation in the Password
input field the Not Secure
popup receives the click and Insecure password warning in Firefox page opens up in the next tab along with Selenium shifting its focus to new tab. Hence test-case starts Failing.In these cases the best solution is:
debanjan
debanjan
to ignore all the UntrustedCertificate
issues.Here is a sample code block to disable insecure_field_warning
:
System.setProperty("webdriver.gecko.driver", "C:\\Utility\\BrowserDrivers\\geckodriver.exe");
ProfilesIni profile = new ProfilesIni();
FirefoxProfile testprofile = profile.getProfile("debanjan");
testprofile.setAcceptUntrustedCertificates(true);
testprofile.setAssumeUntrustedCertificateIssuer(true);
testprofile.setPreference("security.insecure_field_warning.contextual.enabled", false);
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, testprofile);
dc.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(dc);
driver.manage().window().maximize();
driver.navigate().to("http://demosite.center/wordpress/wp-login.php");
Let me know if this Answers your Question.