Bug 937336 - Remove where possible explicit frame switching

Replacing explicit frame switching calls to use the encapsulated switch_to_displayed_app method
Merge pull request #14849 from bobsilverberg/switch_to_displayed_app

Bug 937336 - Remove where possible explicit frame switching