Convert Adapter into RepoItemInfo

Ask general questions here.
Tushar
Posts: 7
Joined: Wed Feb 12, 2020 1:40 pm

Convert Adapter into RepoItemInfo

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Convert Adapter into RepoItemInfo

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

User avatar
N612
Posts: 135
Joined: Mon Jul 11, 2016 4:01 pm

Re: Convert Adapter into RepoItemInfo

Post by N612 » Tue Apr 28, 2020 6:20 pm

I am not sure if this is 100% accurate, but you can convert between C# and VB - https://www.developerfusion.com/tools/c ... to-csharp/

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Convert Adapter into RepoItemInfo

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

Re: Convert Adapter into RepoItemInfo

Post by Tushar » Thu Apr 30, 2020 11:53 am

Thanks for help and sharing this information :)