Search code examples
excelvbaselenium-webdrivermicrosoft-teams

"No account object provided to acquireTokenSilent" error with updated versions of Chrome


I've been developing an automation tool using SeleniumBasic that worked for over two years.

The tool is navigates the MS Teams Web App and provides interactions with multiple chat rooms throughout the evening (using the Classic App and not migrated to the new yet).

I receive the following error when I try to switch to an iFrame after moving from the main window. It seems to have happened after Chrome was updated to version 120.

enter image description here

Minimal code example:

If myChrome.IsElementPresent(FindBy.XPath("//iframe[starts-with(@id,'experience-container')]")) Then
    myChrome.SwitchToFrame myChrome.FindElementByXPath("//iframe[starts-with(@id,'experience-container')]")
End If

The code has not changed, so what has, and what do I need to do to allow it to keep the User Account? I've never supplied anything as I've just navigated the existing elements within the frame and allowed the Teams Web App to process it all.


Solution

  • When researching this error, I found many references to MASL failing etc., but couldn't see where or how this was occurring. It appears with the updated versions of Chrome, there is a large difference in how Chrome itself is handling all the manipulation of the Teams Web App and is now capable of detecting when the bot clicks on something vs the user.

    The only way I could workaround this was by forcing the bot to open the URL to whichever portion of Teams I was trying to utilize (such as the Calendar) an then proceed from there.

    It's a tad kludgy unfortunately, but it beats having to try and develop some way of getting MASL to work with VBA/SeleniumBasic (I'll gladly accept an answer that has a way of solving this deeper need - must be Excel VBA, using SeleniumBasic - but for now, this works.)