Name Mapping not working correctly?
I have this quick function, if the pop up window exists, then the page's url equals the pop up window and the function should click on the radio button, if the pop up doesn't exist, then click the radio button on the main page. I higlighted the popup window and mapped it:
to verify that it was different from the main page that was open, i checked it in the object properties, and it came back with an index of 0 and not 1 like the popup window.
When I run this:
dim RadioButton, p1, page, AliasObj
Set p1 = Sys.Process("iexplore")
Set AliasObj = Aliases.Sys.iexplore1.IEFrame1
If AliasObj.Exists Then
Page = p1.Page("https://epr.medkinetics.com/index.cfm")
Log.Message("Popup not there")
Page = p1.Page("*")
Set RadioButton = Page.NativeWebObject.Find("type","radio")
regardless of whether the popup window is open or not, the result is always true. Any ideas on what I am doing wrong?
Re: Name Mapping not working correctly?
It looks like you are using the Index property to map IEFrame. This property is not stable, and its value can change from run to run. I suggest that you determine whether the pop-up window is opened by searching for the corresponding page, not IEFrame. You can map this page by using the ObjectType and URL properties (for example) or use the Find method (see the "Find Method" help topic) to obtain it.