Launching IE9 with a URL I find two processes are started; a parent and child process. In TestComplete’s ObjectBrowser both processes have a Page node, and the related children.
In my Silverlight AUT(Application under test) there is a datagrid, that I need to scroll.
I check for the scrollbar before attempting to scroll the grid.
However I get different results depending on the process I use.
aqObject.IsSupported(
Sys.Process("iexplore", 1).Page("https://localhost/url/" ).Panel("silverlightContainer" ).Object(0 ).UIAObject("Popup" ).UIAObject("x" ).UIAObject("tab" ).UIAObject("TabItem", 2 ).UIAObject("StepList" )
, "VerticalScrollPercent")
aqObject.IsSupported(
Sys.Process("iexplore", 2).Page("https://localhost/url/" ).Panel("silverlightContainer" ).Object(0 ).UIAObject("Popup" ).UIAObject("x" ).UIAObject("tab" ).UIAObject("TabItem", 2 ).UIAObject("StepList" )
, "VerticalScrollPercent")
One of these will return true, the other false. It doesn’t seem to matter how much I refresh the world Sys.Refresh or the control Sys.Process...UIAObject("StepList").Refresh, one will always fail while the other passes.
This is really odd, but I could work around it if it was predictable, but it isn’t. Sometimes the parent process tree works, sometimes the child.
My question is..
- What is going on?
- How do I decide at the point of launching the app
which process to use for automation? - How else could I achieve my goal of scrolling the list (so I can find the row I want) without experiencing this problem?
This occurs because of Internet Explorer’s LCIE feature (Loosely-Coupled Internet Explorer). It makes Internet Explorer to have a main process and a separate process for every opened web page. You can find more information on this feature along with details on how to disable it in the Preparing Internet Explorer for Web Testing help topic.
Also, you can upgrade you instance of the tool to TestComplete 9. This version allows accessing a page object regardless of the type of a browser and index of its instance. For example: