New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of basic auth. for many browsers #320

Merged
merged 3 commits into from May 1, 2016

Conversation

Projects
None yet
4 participants
@ddemin
Contributor

ddemin commented Apr 28, 2016

Now we can use

Selenide.open("http://somepage.org", "SomeDomain", "JohnLogin", "JohnPassword");

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

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

Additional:

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

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev May 1, 2016

Member

@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);

Member

asolntsev commented May 1, 2016

@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
Details

asolntsev added a commit that referenced this pull request May 1, 2016

asolntsev added a commit that referenced this pull request May 2, 2016

@ddemin

This comment has been minimized.

Show comment
Hide comment
@ddemin

ddemin May 4, 2016

Contributor

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

Contributor

ddemin commented May 4, 2016

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

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev May 4, 2016

Member

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

Member

asolntsev commented May 4, 2016

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

}
SelenideLog log = SelenideLogger.beginStep("open", url);
try {
WebDriver webdriver = getAndCheckWebDriver();
webdriver.navigate().to(url);
if (isIE()) Selenide.switchTo().alert().authenticateUsing(new UserAndPassword(domain + login, password));

This comment has been minimized.

@shimkiv

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

@shimkiv

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

This comment has been minimized.

@simple-elf

simple-elf Aug 9, 2016

Contributor

Bug confirmed in #366
Created pull request #369

@simple-elf

simple-elf Aug 9, 2016

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