For the portal I am testing now, I came with the problem that I could not create any xpath locators, after some time I figured out that it was because of an \'#document\', t
To work with elements inside iframe you must switch to this specific iframe.
iframe
Your solution .switchTo().frame("FRAMENAME"); is correct. Selenium does not have any other ways to work with iframe wrappers.
.switchTo().frame("FRAMENAME");