Create Object from xPath in userCode

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
aumohanraj
Posts: 9
Joined: Mon Jun 06, 2016 10:29 am

Create Object from xPath in userCode

Post by aumohanraj » Mon Jun 20, 2016 1:02 pm

Hi,

Is it possible to create a new webelement in the user code level?

I have the Xpath of the webelement

Thanks and Regards,
Mohanraj Kesavan

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

Re: Create Object from xPath in userCode

Post by odklizec » Mon Jun 20, 2016 1:44 pm

Hi,

I think you can use for example FindSingle (or TryFindSingle) method:

Code: Select all

WebElement webElementItem = Host.Local.FindSingle<WebElement>("your/xpath");
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