check if an item has an accesible name
check if an item has an accesible name
given a repository item, is it possible to check if a it has an accessible name because I'm trying to create an exception in case the repository item doesn't have an accessible name?
Re: check if an item has an accesible name
With the limited information you provided, I can only assume you are trying to do this in a user code module.
You can return a repo item's attribute like this:
Unfortunately being a new user I cannot link you directly to the API documentation, but you can search for more information on GetAttributeValue in Ranorex's API Documentation located in Ranorex Studio > Help menu > API Documentation
You can return a repo item's attribute like this:
Code: Select all
repoItem.Element.GetAttributeValue("accessiblename")
Re: check if an item has an accesible name
That function just accesses the accessible name, I want to prove whether or not an item has an accessible name
Re: check if an item has an accesible name
Try this:
Code: Select all
if(repoItem.Element.GetAttributeValue("accessiblename") == null)
throw new Exception();