Unable to select device to Airplay to when using Selenium on Safari - selenium

Currently I am trying to automate casting to an Airplay device on Safari using Selenium and Robot Framework.
I'm having an issue with being able to select an Airplay device after the Airplay button has been received. The small menu that appears doesn't seem to have any way for Selenium to identify it and so I can't interact with it at the moment.
I had encountered a similar issue when doing a similar task using Chrome Browser with Chromecast, but in that case the device menu had it's own window id which doesn't seem to be the case for the Airplay device menu.
The Airplay button - clicking on this is no problem as this button has its own id within the page html:
This is the menu I can't interact with, I cannot select "QA Apple TV" - looks like this menu isn't part of the actual page html and doesn't seem to have it's own window id:
This Airplay device menu is universal so will come up on Youtube etc. If anyone would like to take a look at it themselves. (Providing there's an AppleTV on your network).

Put your browser in developer mode, watch which value will be setted after click 'QA Apple TV'. In your test you can force the value with javascript.
i.e. : i think that after click some field assume 'QA Apple TV' value; if you know which field will assume the value you can force it with js and force click even with js
(Just to be clear ;) )

Related

Can Selenium handle Browser Notifications in the OS?

In the screenshot below, I make a VoIP call from an incognito window to an account logged in in a normal Chrome window that is minimised. Therefore I receive the Chrome notification in the bottom right corner.
I am tasked with creating a front-end test to validate the text in the notification window, that would work for Windows, Linux, and MacOS situations.
Now this may or may not be a silly question, but is there a way that selenium can handle tasks related with this notification, for example validating the text that appears in it? I can't find anything online and I understand it is not a DOM element, so I wonder if it is even possible. Could someone provide a basic start point for finding this non DOM notification element if it is possible / how to go about testing it in the front end if selenium is not the answer? TIA.
Notification example

Robot Framework - Selenium2Library - Chrome & Edge open new tab instead of window

Sorry if this is a mundane question.
My issue is that the user can click on the "Help" button, which by default will open in a new tab, the help page.
When firing the test in Firefox, it creates a new window. Which is great as I can use the Select Window keyword and give it the URL. However, with Chrome and Edge, it just makes a new tab.
I read that Tabs aren't supported - But the weird part is, the test on Edge passes fine, it is just Chrome which is having the problem. Is there a reason behind that?
Is there a way to force it to be a Window and not a Tab? Or something?
I read that I can input a keyboard shortcut of CTRL + Tab. But that feels really dirty and would prefer a better way of doing it.
Error:
ValueError: Unable to locate window with URL 'http://...
EDIT
OK - So instead of using the URL param, I tried the title instead. Just on a whim. And it worked (?) I have no idea how it worked and why using the URL didnt and the title did: Here are the lines I used:
Run Keyword If '${Browser}' == 'Chrome'
... Select Window 1.7.1 User Guide
... ELSE
... Select Window 1.7.1 User Guide - Welcome to the User Guide
Still though, both the "Gets" did not produce a link to the newly created tab / window though :/ - Many thanks to shicky and Helio!
Are tabs not handled largely the same as windows? You should be able to identify what is on the screen as #Helio says by using one of the following:
Get Window Identifiers
Get Window Names
Here are some similar questions that should help you get started, post back here with some further detail if you need more help.
How to get the current URL in Robot framework?
How to make chrome display on the top opened in selenium [Mac OS X]

Why is "Show page source" not available in (my) WebKit?

I've downloaded v. 537.6+ of WebKit for Mac OS, and am running it on 10.8. (No programming here, just being a web developer looking for the WebKit web inspector.) Everything's fine, except the "Show page source" option in the Develop menu is grayed out when I'm on even the most, and I can't find any way to enable it. I"m very puzzled -- is there something else I need to do to get it enabled? Is there something else going on? Is this how it's supposed to be?
Developer Menu
The contextual menu:
WebKit is not a full browser - only a rendering engine. Typically things like "view source", the back/forward buttons, address bar, preferences menus etc. are implemented at the browser level, outside of WebKit. However WebKit probably provides a minimum implementation of these for testing purposes, which presumably excludes 'view source' (which I can imagine isn't really essential for testing).
If you want to play with a full browser, you can't compile all of Safari, but you could try compiling Chromium instead which provides all that stuff. Note however Chromium is now using Blink instead of WebKit.
You can enable WebInspector to view the source.
The webkit you have is a very old one. I've tried downloading it to help with your question, but it won't even run on OSX 10.8.3. You can always get the current latest build of WebKit here:http://www.webkit.org [edit: I see this question was asked in 2012, so that would explain why it's an old version.]
However you say you are "a web developer looking for the WebKit web inspector" and you are running OSX 10.8. In that case you can perhaps just use the standard Safari that's already on your Mac. You need to do the following to show the Develop menu. And then you have the "Page Source" item you are expecting.
Launch Safari.
Open Safari’s Preferences by selecting ‘Safari, Preferences’ from the menu.
Click the ‘Advanced’ tab labeled.
Place a check mark next to ‘Show Develop menu in menu bar.’

Safari in kiosk mode or full screen with no tool bars

I have created a html5 video gallery that will be used as a kiosk in a casino. The videos play the best in safari but I cannot get safari to go completely full screen. Is there a way to do this or a application I can use? I've looked into saft but it is not compatible with the new version of safari.
Thanks in advance
At least on Windows version of Safari (5.1.7), To make it go full-screen you have to press F11.
You will still see a tool-bar, but it should automatically hide after a few seconds, and then you will be in complete full-screen mode.
Note: If you press F11 before all the content of your page are loaded, you might have some layout problems, so I recommend to wait for the content to be loaded.
I wish there was a way to make full-screen mode enabled from start up like you can do with Google Chrome with the kiosk mode, but I don't know if that is possible.
You should probably use a third-party kiosk application designed for this purpose such as xStand, since Safari doesn't contain any actual kiosk mode (unlike Internet Explorer).
Even then, you'll need to be aware of the risk of users using keyboard shortcuts to exit the application (like Cmd+Q, or Cmd+Opt+Escape to bring up the "Force Quit Applications" list).
Most dedicated kiosk browsers are designed to disallow that sort of behaviour, but you should definitely test them yourself before you trust them (or disconnect the keyboard altogether if users don't need a keyboard).
On the other hand, if you can safely remove the keyboard and mouse, you're able to simply use the built-in full-screen mode in Safari (as of OS X Lion), to achieve what you're looking for.

Safari - How To Automate The Reset Safari Items

Using Safari browser and finding one hurdle to making it my default browser - there is no default setting for clearing/deleting all the stuff you find in the menu's Reset Safari panel.
I made an Automator routine using the 'Watch Me' to do this and quit safari - it works. But, I'd really like to not have the steps display while it's running. The show actions is not selected but, they still show.
I tried creating a script but Safari dictionary does not have the option for Reset (or any of the reset panels items...)
So, how can I accomplish this?