Can we make the Adapter type dynamic in VS ?

Experiences, small talk, and other automation gossip.
rparida51
Posts: 1
Joined: Mon Aug 03, 2020 2:37 pm

Can we make the Adapter type dynamic in VS ?

Post by rparida51 » Mon Aug 03, 2020 2:55 pm

Hi,
Actually i am looking for, if any way it is possible to do a change the Adapter type in run time. Can any one suggest what are the possible solutions.
Find the code snippet below.

WebElement element = null;
string xpath=null;
element = Host.Local.FindSingle( xpath).As<(InheritedType of Adapter)>();
I want if (InheritedType of Adapter) can be modified on runtime.
instead of always in the below manner
element = Host.Local.FindSingle( xpath).As<(WebElement )>();
OR
element = Host.Local.FindSingle( xpath).As<(SpanTag)>();

or...
I want to pass global Type (T). it didn't work as it is taking only inherited Types of Adapter
Please suggest the possible solutions ...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12143
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Can we make the Adapter type dynamic in VS ?

Post by Support Team » Fri Aug 14, 2020 7:45 pm

Hi!

Please contact us via the links below and we will be more than happy to further assist you with this! Kind Regards,
Ranorex Team
.
Image