I'm facing an issue while trying to select a button within a Frame. Despite my efforts, I am unable to make the selection. Below is the code snippet that I used to switch to the frame and click on the element in Protractor using TypeScript:
await browser.switchTo().frame(element(by.xpath("//div[@id='main-container']")).getWebElement());
await this.element(by.css('.uploadDiv #uploadP')).click(); --> This did not work
let frame3 = element(by.xpath("//div[@id='main-container']")).getWebElement();
browser.switchTo().frame(frame3);
await this.element(by.css('.uploadDiv #uploadP')).click(); --> This did not work