Colin_McCrae
11 years agoCommunity Hero
Chrome 32 - Audio Indicator?
Hi
You may have noticed that Chrome 32 has introduced an audio indicator in the tab for that page. Any time audio is played by the page open on that tab, you get a little speaker to indicate that its playing audio.
Is there any way TestComplete (I'm running v10) can watch this icon and detect it appearing when audio is played? I can't seem to find any way to identify/get to it ...
Or if there is some other way I can detect audio events within a browser, please let me know. I've not managed to find anything so far. The application/site I'm testing makes a short "beep" when certain events happen, if possible, I would like to detect the "beep" as part of my test pack. Doesn't need to do anything clever like determine what the sound was or anything, so the visual indicator would be fine ...
You may have noticed that Chrome 32 has introduced an audio indicator in the tab for that page. Any time audio is played by the page open on that tab, you get a little speaker to indicate that its playing audio.
Is there any way TestComplete (I'm running v10) can watch this icon and detect it appearing when audio is played? I can't seem to find any way to identify/get to it ...
Or if there is some other way I can detect audio events within a browser, please let me know. I've not managed to find anything so far. The application/site I'm testing makes a short "beep" when certain events happen, if possible, I would like to detect the "beep" as part of my test pack. Doesn't need to do anything clever like determine what the sound was or anything, so the visual indicator would be fine ...
Hi Colin,
I performed some investigation. It turned out that the value of the Description property of the target tab is changed when the music is playing on it. This tab is playing audio is added to the end of the tab title. You can check it in the Object Browser. So, you can use the script below to identify whether the music is playing on the specified tab:
//JScript
function TestAudioIndicatorInChrome()
{
// change <TAB TITLE> in the line below
var tabObj = Sys.Browser("chrome").BrowserWindow(0).Client("Google Chrome").
Client(1).Client(0).TabList(0).PageTab("<TAB TITLE>");
var tabTitle = tabObj.Description;
var strPlay = "This tab is playing audio";
var Res = aqString.Find(tabTitle, strPlay);
if ( Res != -1 )
Log.Message("The music is playing")
else
Log.Message("The music isn't playing")
}
How does it work for you?