Hi,
I was wondering if what I was doing was smart or efficient, or if there was a better way.
I created a function to click on a ranorex object type, such as an InputTag or an ImgTag, when I pass it in.
My click function is declared as such: Function Click(MyControl as Ranorex.Unknown)
When I'm in another function and I declare an object, such as Ranorex.ImgTag, and I assign something to it, when I want to click on it I call my click function as follows: click(MyImgTag.As(of Ranorex.Unknown))
This works, but I'm wondering if there is a way I can just pass the object without converting it to unknown, since I often forget to do it and it's annoying to do? Obviously if I don't convert it it won't compile.
Another thing I've noticed, is I can decalre my click function as such: Click(MyControl as Ranorex.Core.Element). This allows me to pass in anything without converting it first to unkown and allows me to do some basic things, like check if it's visible. But I cannot do more specific things like click on it unless I convert the element to something specific using Adapter.Create.
FYI: I have my own click function (and other functions like this) because I need to do work to figure out if it's visible and if I should scroll it into view)
Thanks,
Aracknid