Normally, I would do something like this:
Code: Select all
Ranorex.Text textAdapter = itemInfo.CreateAdapter<Ranorex.Text>(true);
Ranorex.Input inputAdapter = itemInfo.CreateAdapter<Ranorex.Input>(true);
The below thread shows me how to do it using the RxPath, but I was wondering if we can do it directly from the RepoItemInfo object.
http://www.ranorex.com/forum/dynamic-id ... t2753.html
The below code snippet is what I would like to do, but obviously it won't work:
Code: Select all
public void SetAttribute(RepoItemInfo itemInfo, string attribute, string value)
{
if (itemInfo.Exist())
{
Ranorex.Adapter itemAdapter = itemInfo.CreateAdapter<itemInfo.GetType()>(true);
itemAdapter.Element.SetAttributeValue(attribute, value);
}
}