Hi,
I started with login url, then it redirects me to one webpage, it has multiple redirects before reaching this page.
Then on this page, I hover and element(menu), then try to click the hyperlink on this pop-up.
Then page was redirected to the final page that I need. this page has three iframes, I need to switch to the second iframe and do some work here(find an element first.....). All of those redirects and operation are on the same Tab.
qc1.log:

qc10.log:
I hover over the menu, but i did not click it. But script continue runing, it tried to find the iframe but since i didnot click the hyperlink, so page didn't change, iframe will not appear.

qc11.log:
another change:
I hover over and clicked the hyperlink using JS.
self.driver.execute_script(
'document.querySelector("nav.mc-header-app-switcher-region > div > ul > li:nth-child(2) > ul > li:nth-child(2) > div.mc-app-group-dropdown > ul > li > a").click();')
This click started in the log at line 4621, completed at line 4855.
Then i try to find the iframe I needed. Then switch to this iframe. Those two steps completed successfully as well, from line 4856 to line 5285.
Then the i try to find a button, but failed with nosuchwindow exception. This step starts at line 5286.
Question:
why executionContext was destroyed after I try to find a button in that iframe? And navigate to frame and create a new execution context after SwitchToFrame?
I have to agree those steps all in 1 second, really quick.

qc115.log:
This time, I add 5 seconds sleep. executionContext was also destroied after I try to find a button on that iframe.
Actually, no matter how long do i sleep, executionContext would be destroyed after I try to find a button on that iframe.
This proof that executionContext's destroy is not relate to time.

Question:
There is a frame navigation and executionContext creation, that is probably because the click take me to new page so we need a new execution context. But why there is no frameNavigated log during SwitchToFrame? Why the execution context did not change after switched to new frame?
在 2020年2月12日星期三 UTC+8上午3:26:55,T Crichton写道: