IE page which is consisted of some frames.

Feb 17, 2014 at 11:42 AM
Hi everyone. I’d like to automate an IE page which is consisted of some iframes. I tried to figure it out, but I didn’t know what kind of commands combination is correct.

Get-UiaWindow -Class 'IEFrame' -Name 'Title - Internet Explorer' | Get-UiaPane -Class 'Frame Tab' |
Get-UiaPane -Class 'TabWindowClass' -Name 'Title - Internet Explorer' | Get-UiaPane -Class 'Shell DocObject View' |
Get-UiaPane -Class 'Internet Explorer_Server' -Name 'Title'

After above, I tried to put Get-UiaCustom, Get-UiaWindows, and Get-UiaPane. But I don’t know which combination is correct to recognize the iframes. Any kind of help will be appreciated. Thanks in advance.
Coordinator
Feb 18, 2014 at 6:49 AM
Hi,
unfortunately, what can be get via hovering over by the mouse (AutomationElement.FromPoint()), not always available via search (AutomationElement.FindAll()). IE is a good example, I mean a good bad example. Try Firefox instead.
I failed to get even iframes in IE, oppositely in FF not only iframes themselves are available, but their internal elements available too. Slowly, but available.

Example:
assuming that you've downloaded these files (that have been made from w3schools's samples)
file1, file2, file3, put them in a folder and run the firt in FF:
$lists = Get-UiaWindow -Class 'MozillaWindowClass' -Name 'Mozilla Firefox' | `
Get-UiaDocument -Name '*iframe*' | `
Get-UiaDocument -Name '*frameContent1*' | `
Get-UiaList

$lists.Count;
$lists | Read-UiaControlName;
$lists | Read-UiaControlAutomationId;
$lists | Read-UiaControlClass;

$edits = Get-UiaWindow -Class 'MozillaWindowClass' -Name 'Mozilla Firefox' | `
Get-UiaDocument -Name '*iframe*' | `
Get-UiaDocument -Name '*frameContent2*' | `
Get-UiaEdit

$edits.Count;
$edits | Read-UiaControlName;
$edits | Read-UiaControlAutomationId;
$edits | Read-UiaControlClass;
Not so bad? In the first frame, there are 5 lists. The happiness stops here: they are and elements below don't have names, automationIds, classnames, only type.
In the second frame, there are 3 edit and 4 labels, UIAutomation counts them as 7 edits. This means that you need to navigate among them a-la "next sibling", "first child", etc.

Totals: IE seems to be a very poor choice, there is little chance to get it working. FF looks promising, though it also requires hard work and patience.
Feb 19, 2014 at 9:25 AM
Hi, thank you for taking your time. I'll try it later.