Ask general questions here.
-
Tushar
- Posts: 7
- Joined: Wed Feb 12, 2020 1:40 pm
Post
by Tushar » Tue Apr 28, 2020 2:03 pm
I want to convert Adapter into RepoItemInfo -
Code: Select all
Public Sub DemoSub (PointClick as Adapter)
Dim PointClickInfo As RepoItemInfo = PointClick .RepoItemInfo ' <-- This is not working
End Sub
Kindly provide your solutions
-
odklizec
- Ranorex Guru
- Posts: 7470
- Joined: Mon Aug 13, 2012 9:54 am
- Location: Zilina, Slovakia
Post
by odklizec » Tue Apr 28, 2020 2:10 pm
Hi,
You can't convert Adapter to RepoItemInfo. It's only possible to convert RepoItemInfo to Adapter! To be quite honest, you should use RepoItemInfo as parameter of method (to avoid potential ElementNotFound exception) and then convert RepoItemInfo to Adpater. Unfortunately, I'm not fluent in VB so I cannot provide you with VB code sample. In C#, we are doing it like this:
public static void CustomMethod(RepoItemInfo repoElement)
{
repoElement.CreateAdapter<Ranorex.Unknown>(false).Click();
}
Pavel Kudrys
Ranorex explorer at
Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
odklizec
- Ranorex Guru
- Posts: 7470
- Joined: Mon Aug 13, 2012 9:54 am
- Location: Zilina, Slovakia
Post
by odklizec » Tue Apr 28, 2020 8:16 pm
Hi,
Actually, there is a code conversion tool directly in Ranorex Studio. I’m always forgetting about it
Pavel Kudrys
Ranorex explorer at
Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
Tushar
- Posts: 7
- Joined: Wed Feb 12, 2020 1:40 pm
Post
by Tushar » Thu Apr 30, 2020 11:53 am
Thanks for help and sharing this information