I have a frame tag stored in an object, and I also have the WebBrowser stored in an object. I'm looking for an Anchor within the frame. The frame is in the WebBrowser. And the Anchor is in the Frame.
PathToAnchor = ".//a[@id='MyID']"
If I do this code, it works (finds the anchor):
if not BrowserObj.TryFindSingle(PathToAnchor,DelayTime,MyAnchor) then 'Failed to find the anchor. handle it end ifBut if I do this, it does NOT work (it give a runtime error)
if not FrameObj.TryFindSingle(PathToAnchor,DelayTime,MyAnchor) then 'Failed to find the anchor. handle it end ifThe error I get is "Value cannot be null.Parameter name: adapter"
However (and this is the confusing part), if instead I change the code to this, it DOES work and I have no idea why. I've used TryFindSingle many times before in my code and never run into this...
MyAnchor = FrameObj.FindSingle(PathToAnchor,DelayTime) 'Works. MyAnchor is found...Any thoughts?
Using Ranorex 3.3.1 and VS2012