Implementation of basic auth. for many browsers #320

merged 3 commits into from May 1, 2016


None yet

4 participants


Now we can use"", "SomeDomain", "JohnLogin", "JohnPassword");

if we want to pass basic authentication.
Supported (and tested) browsers:

  1. IE11
  2. Chrome
  3. Firefox
  4. PhantomJs
  5. HtmlUnit


  • UnsupportedOperationException added to catch() clause in getJavascriptErrors() method (specially for HtmlUnit)
  • Tests for Chrome, IE, PhantomJs disabled because executables are needed

@dimand58 Do we really need to disable CSP?
For example, we configure CSP policy, why not to test in via selenium tests?

myProfile.setPreference("security.csp.enable", false);

@asolntsev asolntsev merged commit e996546 into codeborne:master May 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
@asolntsev asolntsev added a commit that referenced this pull request May 1, 2016
@asolntsev asolntsev #320 fix checkstyle issue aedd335
@asolntsev asolntsev added a commit that referenced this pull request May 2, 2016
@asolntsev asolntsev #320 fix checkstyle issue 48144be
dimand58 commented May 4, 2016

I checked security.csp.enable in corporate network - it is useless proprety which have no influence on basic auth


@dimand58 yes, it's useless for basic auth, but probably it's useful for something else? Do we really need to disable it?

@shimkiv shimkiv commented on the diff Aug 9, 2016
SelenideLog log = SelenideLogger.beginStep("open", url);
try {
WebDriver webdriver = getAndCheckWebDriver();
+ if (isIE()) Selenide.switchTo().alert().authenticateUsing(new UserAndPassword(domain + login, password));
shimkiv Aug 9, 2016 Contributor

Hey Guys,
in case if BasicAuth is not required then exception will be thrown since we will not be able to switch to alert.
We should handle this case inside an additional try-catch block (without exception throwing) or introduce the new Configuration property

simple-elf Aug 9, 2016 edited Contributor

Bug confirmed in #366
Created pull request #369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment