Not able to handle windows authentication window using Appium in safari browser - windows

We are automating our website using Appium in Mac iOS device .
when we access our application, it shows windows authentication pop up window. we used the format(https;//username:password#test.com) to handle the windows popup window in chrome and Firefox browser and it is working fine . but windows authentication popup window is appearing in safari browser. could you please let us know how we can handle windows popup window in safari browser
my system configuration
Mac OS version 10.14.5(macOS Mojave)
Appium version 1.14.2
iPhone version 12.4

What does the windows popup in Safari browser look like? If it's a standard login form with username / password inputs, you may need to locate the username / password textfield elements & call SendKeys.
I recommend using the Appium inspector to reproduce your scenario & inspect the Safari browser there.
I have faced a similar issue when handling my organization's single sign on page. After logging in & automatically closing the sign on browser page, my AppiumDriver context became stale & stopped working. so I had to call Driver.BackgroundApp(); to fix it.
If the username / password input is an 'Alert' style popup, you can refer to this forum here which has a few workarounds:
https://discuss.appium.io/t/handle-http-authentication-on-ios-safari/1480/7

Thank you so much for replying my question .
the below code is working perfectly
driver.get("https://test.com");
driver.context("NATIVE_APP");
driver.findElement(By.Xpath("uname"));
driver.findElement(By.Xpath("pwd"));
driver.findElement(By.Xpath("login"));
driver.context("WEB_VIEW");

Related

Can I control another app from my macOS app?

I'm looking to control another app from my macOS app.
I want to
check tab' URL in a browser (Safari, Chrome)
change tab' URL from my app
I noticed an app got Automation permission.
Use AppleScript to get and control browsers and other apps.
AppleScript can get the URLs a browser have been opened and change the tab's URL to what you want.

Is Firefox Automation on MacOS using NSAccessibility APIs / XCUITest Framework possible?

Can Firefox on MacOS be automated using NSAccessibility APIs or XCUITest framework?
I can access only few buttons of Firefox Window. I want to perform some actions on an alert box, which is from one of the Firefox extension javascript. I have checked using Accessibility inspector as well. However VoiceOver on MacOS can access all the buttons. So I think there is possibly some way to do it.
Any help how to get this working? TIA.Please check Firefox window, which I am trying to automate, here.

Safari dialoge box is not opening in automaton browser instance

I am automating an application on safari browser using Selenium and Java.
For uploading a file on safari browser, I need to click on upload button.
But the dialog box for selecting a file is not showing in Automation browser instance.
While in regular safari browser (other than automation instance), I can see the dialog box for the same page.
What's the reason for dialog box not opening in safari automation instance?
Its Apple webkit's issue. Reference - https://github.com/SeleniumHQ/selenium/issues/5236
Solution is to either downgrade Safari version and use Selenium's safari driver or wait for Apple webkit to fix this issue.

What browser does Office 2016 on Mac use for taskpanes?

I've got a Word add-in working well on Windows, and the basics are working on Mac also (Word 2016 both).
What browser does Word 2016 for Mac use?
I see this post:
What browser / browser engine do Office Add-ins use?
But it doesn't explicitly define the way Mac does it.
I see posts about clearing the cache, which is helpful (that will be my next challenge) like How to clear client side browser cache for Excel 2016 Task Pane add-in on Mac?.
Specific reason I'm asking is trying to use Firebase for authentication. On Windows, because Word 2016 uses IE11, clicking Login (with Firebase running the show) in my taskpane pops open IE11...and the login through the full browser is recognized by the Taskpane.
On Mac, clicking Login is opening my default browser...
Alternately I could try to keep the Firebase flow in the Taskpane...but not sure how to do that:)
Mostly curious how Microsoft is kludging this on Mac.
For Mac, the native WebKit control is being used (https://developer.apple.com/reference/webkit/webview). Window.open or other popups will open in the default browser and not share cookies or have window.opener pointer to the WebKit control by default. This does not work in authentication scenarios. If you want the popup window to be opened in a separate WebKit control for authentication, you will need to include the trusted domain in the AppDomain list of the manifest: https://dev.office.com/reference/add-ins/manifest/appdomains. window.opener and cookies should then work between the popup and add-in. The AppDomain list is supported on every platform.

Show Firefox OS devtools on Firefox Developer Edition 'desktop'

I've an iMac with OS X Yosemite v.10.10.3. I use Firefox Developer Edition 40.0a2. I've a ZTE Open C (FR version) with Firefox OS; Boot2Gecko 2.1.0.0-prerelease (B2G OS).
What I'd like to do is the following: I've a basic webpage (mostyl HTML, CSS and JS) opened in my browser on my Firefox OS phone. I'd like to get the devtools (Cmd+Shift+i) and be able to edit that webpage with my Firefox Developer Edition browser on my iMac.
I've already tried these things:
Use webIDE.
Follow this potential solution.
Connecting a Firefox OS device.
WebIDE Troubleshooting.
Comment déboguer facilement du web y compris sur tablettes et téléphones—french article.
With webIDE, I can build a new app for Firefox OS (with or without a base theme) and I can use the devtools to inspect the DOM and stuff like that. I just want to achieve the exact same thing but directly on my desktop computer.
Do you have any clue?
Feel free to ask me if you need more piece of informations. ;)
Current status
When I launch the Firefox OS browser app, I can inspect (via the devtools) the homepage (DOM stuff, etc.). But when I load another webpage (Google for example), I can't inspect the DOM. Any idea about that?
I often get this message: http://puu.sh/ir2Ju/32563e51bc.png when I switch to several apps I want to debug.
If I understand correctly, you're trying to connect the Firefox Developer Edition WebIDE on your desktop to a tab that is open on your Firefox OS phone. Something like this?
If that's right, once you connect to your phone in the WebIDE, you should see a list of open browser tabs at the bottom of the "Open App" menu, which is in the top left of the WebIDE panel.
When you connect your phone, you have to accept remote debugging.
Then on the left of the window, you should see a dropdown menu with the apps that you can debug. By default, you can only debug unprivileged applications.
Click on the app, the you want to debug and in the middle of the screen click on the "wrench". It is the button to activate debugging.
Now the complicated part. In order to debug privileged apps such as the web Browser. You have to root your phone and change some preferences. To check that you have a rooted phone. Click on the runtime menu and then runtime info.
If your adb is in root mode, then you can press the button to request higher privileges. You can also do that by hand.
There for more info:
https://developer.mozilla.org/fr/docs/Tools/WebIDE/Running_and_debugging_apps#Unrestricted_app_debugging_%28including_certified_apps.2C_main_process.2C_etc.%29
https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager#Using_the_B2G_desktop_client
Using a real device
On your computer, enter the following command in Terminal/console to enter your device's filesystem via the shell:
adb shell
Your prompt should change to root#android. Next, stop B2G running using the following command:
stop b2g
Navigate to the following directory:
cd /data/b2g/mozilla/*.default/
Here, update the prefs.js file with the following line:
echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js
After you've finished editing and saving the file, start B2G again using the following command:
start b2g
Exit the android filesystem using the exit command; this will return you to your normal terminal prompt.
Next, reconnect to the App Manager and you should see certified apps appear for debugging.
When this is done, you should see the application "Browser" in the list of available apps for debugging. At the same time, you should see all other application of your phone available as debugging.

Resources