Selenium Java - How to verify that a browser notification is displayed? - java

I am using Java and Selenium in order to test a web application that requires Adobe Flash Player to be enabled in order to continue. I am trying to verify that a browser's notification displays (See below image). I am not looking to click/select "allow" or "block", I am only testing to see if the notification displays in the browser. How could I accomplish this? I would be testing a variety of different browsers including chrome, firefox, internet explorer, microsoft edge, and safari.
Browser notification example

Related

outsystems iFrame issue

I'm using outsystems and I am trying to get the app to run in their browser but something about iFrame popped up. How do I disable iFrame so that the app can run in the browser?
"Your app requires native access to a Local Storage database that is not available in your browser while using an iframe.
Please test your app in your mobile device or use Google Chrome"screenshot
Try this:
On Safari Options go to Advanced > Experimental Features and at the end turn off the option that say Disable Web SQL.

Camera usage notification at mozilla firefox

I'm writting an automatied test with using selenium dirver and geckoDriver for mozilla firefox v56. The application which I'm testing always ask user to allow the camera usage and always this notification is displayed:
The problem is that, the Mozilla browser session which is created by geckoDriver does not saved settings where I always allow this page to use the camera driver.
I'm talking about this solution: https://support.mozilla.org/en-US/kb/firefox-page-info-window
I cannot find any parameter in about::config page which which I can run firefox to never ask about this permission again. Can I ask for your help?

Page Not Loading in Firefox after Authentication

I have written Java code using Selenium Webdriver and AutoIt that opens a Firefox driver, navigates to a page that requires authentication via selection of a soft certificate, selects the appropriate certificate when the Certificate Selection window pops up, and clicks OK, at which point the page I'm accessing should load but instead it just loads a blank "New Tab"; a new tab isn't opened per se, just the current tab remains blank with the title of "New Tab".
If I perform this process manually (without having Selenium Webdriver open a Firefox driver and I just launch it myself) using the same exact Firefox profile, the page loads after authentication just fine. I should also note that the page loads successfully using driver instances of Internet Explorer and Chrome.
I am using Firefox v33.1, IE 10, and Chrome v38. Finally, I should note that this has nothing to do with my automated certificate selection process because even if I only have Selenium Webdriver open a Firefox driver and stop there and then I take the wheel and select the certificate myself and click OK, it still does the same thing.
I think Selenium Webdriver might have some annoying guard built into the Firefox drivers it instantiates that prevents it from loading pages requiring authentication. If this is the case, does anyone know how to possibly disable that?
Java needed to be set to "Always Activate" under the Firefox Add-ons -> Plugins. Before it was set to "Ask to Activate" but it never explicitly asked to activate after I selected the certificate, thus the page wouldn't load.

Fetch Browser history details from browser other than default in android

I'm developing an app in which i need to fetch the URL's that are accessed by the user. I've successfully fetched the URL's from android's default browser. I know that some browsers are protective towards this act. But i need to know whether there's any work around that could succeed this objective. Mainly from opera and dolphin browser

Java: Control browser through Process

I'm remote controlling a Java application on a PC through an Android phone, and I needed my application to open a browser at the phones command, chrome in this case. I created a "Process" for chrome, opening a certain address. However, I need to be able to give tools on the Android phone for controlling the web page, such as scrolling. Can I programmatically send a command for chrome to scroll from my PC application containing the Process?
Sorry, it may have been unclear, but the only connection the android phone has to the program is through a socket. It is only used as a remote control for another Java application on a PC, which has its own screen.
I do not think that clean solution exists.
But I can suggest the following directions:
(1) try to investigate the native chrome API. If it has such ability call it with JNI.
(2) Try to use class java.awt.Robot. It allows to simulate user's activity, e.g. mouse clicks. Unfortunately it does not allow you to find any window outside your application, so it is a problem to decide where to perform the click.
(3) You can create proxy server and make browser you open to go to the target URL through the proxy. The proxy server will insert into the page your javascript that will communicate with server. The application that opens browser will send commands to server. The javascript that you inserted will receive these commands using AJAX and perform them. JavaScript can scroll browser window, so theoretically you can implement this.
If you can target the tab you want to control and edit the address bar you could send the command 'javascript:scrollTo(x, y)'. I just tested it on this page and it seems to work fine, replacing what I typed with the original address of the page.
Can I programmatically send a command for chrome to scroll from my PC
application containing the Process?
Not directly. What you could do is make some sort of web service that sits between the Android client and page that the Android client can send commands to and the page can periodically poll via AJAX calls to see what the client wants. That would be a clean DIY way that would work on other browsers besides Chrome.
You can use vnc viewer applications for that.
http://code.google.com/p/android-vnc-viewer/

Categories