Is there a way of inputing the username/password of an http authentication using Appium on Safari iOS? The pattern http://username:[email protected] doesnât work, and I canât find a way of inputing user/pass on the pop up dialog. Please help me!
When you access a website that has a http authentication (example: integration.westelm.com ), it pops up a dialog asking for username and password, but Appium doesnât provide a way of filling this automatically, so weâre not able to perform tests on this website.
Thanks for the answer @SergeyTichomirov . Actually I donât use proxies yet, but Iâll take a look. Anyway, it would be great if Appium could fill the authentication pop up on iOS. I believe that isnât a hard thing to do anyway.
I am using Browser Mob Proxy (version 2.1.0 beta-1), Appium (1.3.6) with Appium provided Java client (ver: 2.1) library. But Appium failed to set Proxy when start AppiumDriver and returning âOriginal error: Instruments never checked inâ exception. I tested on iphone-simulator on iOS 8.1. Setting Proxy using below code
Proxy proxy = BMP_Proxy_Controller.Server.seleniumProxy();
objCapabilities.setCapability(MobileCapabilityType.PROXY,proxy);
objCapabilities.setCapability(MobileCapabilityType.ACCEPT_SSL_CERTS, true);
Log captured from Appium server:
{âdesiredCapabilitiesâ:{âorientationâ:âPortraitâ,âacceptSslCertsâ:true,âbrowserNameâ:âSafariâ,âautoLaunchâ:true,âlocaleâ:âUSâ,âsafariAllowPopupsâ:true,âlocationServicesAuthorizedâ:true,ânewCommandTimeoutâ:â600000â,âautoAcceptAlertsâ:true,âsafariIgnoreFraudWarningâ:true,âplatformVersionâ:â8.1â,âfullResetâ:false,âdeviceNameâ:âiPhone 5â,âplatformNameâ:âiOSâ,âproxyâ:{ânoProxyâ:null,âsocksUsernameâ:null,âhttpProxyâ:âNDI-LAP-371.3pillar.corp:8019â,âftpProxyâ:null,âsocksPasswordâ:null,âsslProxyâ:âNDI-LAP-371.3pillar.corp:8019â,âproxyAutoconfigUrlâ:null,âproxyTypeâ:âMANUALâ,âclassâ:âorg.openqa.selenium.Proxyâ,âautodetectâ:false,âhCodeâ:1056099159,âsocksProxyâ:null},âbundleIdâ:âcom.apple.mobilesafari.appâ,âdeviceReadyTimeoutâ:â450â,âlocationServicesEnabledâ:false}}
info: Client User-Agent string: Apache-HttpClient/4.3.4 (java 1.5)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : acceptSslCerts, proxy,
Hey guys, I found the solution to access http authentication websites. Itâs actually kind of weird but it works:
Before accessing the http authentication protected website, ask selenium to go to page âaâ, and then send the goto to users/[email protected], like this:
browser.goto('a') #appium workaround for the http authentication to work
browser.goto("http://username:[email protected]")
thanks man!
This was extremely helpfull!
unfortunatelly the solution with login and passwort in URL did not work for the iOS Safari.
alert did not work too
working with elements started to work when I have changed to the native!
driver.get(âhttps://www.example.comâ); driver.context(âNATIVE_APPâ);
driver.findElement(By.xpath("//*[@type=âXCUIElementTypeTextFieldâ][@value=âLoginâ]")).sendKeys(âTestâ);