Chrome inconsistent behaviour with TC11.20
Since the NPAPI plugin was switched off, I haven't had much cause to run my large test suite which uses Chrome.
I was asked to run it yesterday and have found a rather large problem (from my perspective).
I have been running these tests for a couple of years now and with the old NPAPI plugin, all was well. With whatever it's been replaced with, all is no longer well.
Context:
I run multiple instances of Chrome during the test.
Each instance is on a different URL. So I identify the page by URL.
I send "Keys" to the Page object of each different browser.
Sometime the browsers open (there can be up to 5) have to be full screen. So they are not always all visible.
Using the NPAPI plugin, I was able to send "Keys" to any page, regardless of whether it was the one currently in the foreground or not. Now, that does not seem to be the case.
With 3 broswers open - device10, device11, device12. Opened in that order so device12 is on top, then 11, then 10.
I assign the device10 page to an object before I interact with it. I've put in a breakpoint and checked that the correct page has been assigned. It has. It then sends the Keys to the page. But the keypress is not going to device10, it's going to device12. (I can see this as device12 flashes in the task bar when the keypress is sent)
In other words, it send the Keys to the browser on the top of the pile.
This has not been thge behaviour for the last couple of years. Keys went to the correct browser, regardless of whether they were in focus/on top. This is causing masses of false failures in my (large - approx 5 hour run) tests.
When investigating, I notice that the properties of Chome pages don't seem to be right either. All 3 browsers show "VisibleOnScreen" as TRUE. Which is wrong. They are all full screen. Only the top one is visible.
I'm going to have to try and find some sort of hacky workaround to force it to bring the browser/page I want into focus/foregound, which is not ideal. So far, it seems I'll have to use the BrowserWindow object associated with the page as it offers an "Activate" method. The Page object does not. The first child Panel of page also does not. It does offer a "Focus" method, but this does nothing. It does not bring the browser/page to front. Doing a sys.refresh at various points also makes not difference. Using BrowserWindow is not ideal as the link between each Page and it's BrowserWindow object is not obvious by the URL .... which is the way I tell them apart currently. I'm going to have to hack in some sort of search for an identifier name within the page and then match that to the BrowserWindow caption. Horrible.
Not sure where else I'm going to run into similar problems where things used to work in the background and now don't. I'll only find out as I fix things bit by bit.
But sending Keys to the wrong browser (despite the correct one being identified and assigned correctly beforehand) is already a major problem for me. Huge tests which I've been running successfully for years are now a complete mess thanks to this.