How to find the location of a audio file that's played on a button click to grab it with selenium

Viewed 49

When I click a button audio plays, I'm not extremely familiar with javascript, this is the HTML code of the button:

<div class="voice-speaker bg-audio-speaker-on" ng-click="self.onRefreshClick()" ng-class="{ playing: self.isSoundPlaying }" style="background-color: rgb(170, 170, 170); height: 200px; width: 200px; transform: matrix(1, 0, 0, 1, 0, 0);"> <div ng-show="self.soundFileQueue.isElectronicVoicePlaying" class="electronic ng-hide">Electronic</div> </div>

Im assuming it's calling self.onRefreshClick(), but where would I find the code onRefreshClick runs?

1 Answers

This is kind of hard to answer without seeing the HTML file itself. Generally speaking there should be some type of script section to that HTML file where that should be defined. I'm not entirely sure what convention is, but I generally put all my javascript at the bottom of the HTML file, so you might start there. It should look something like this:

<script>
some javascript for onRefreshClick here
</script>

If that doesn't work, then I would suggest just using Ctrl + f and searching it that way, which will will probably be the quickest. If you are using your browser's inspect functionality, then there should be a search option at the top somewhere too.

Related