uiautomationvalue

Ask general questions here.
mander95
Posts: 66
Joined: Tue Jun 21, 2016 7:35 pm

uiautomationvalue

Post by mander95 » Tue Jul 26, 2016 9:38 pm

trying to create a function that takes in ranorex text, gets it's uiautomationvalue, converts it to a sting to be compared to an input string and click that text if it matches the uiautomationvalue. This is what it is intended to look like:

public void clickButton(Ranorex.Text repositoryText, string inputText){
if(repositoryText.GetAttributeValue("UIAutomationValue").ToString()==inputText){
repositoryText.click();
}
}

something along these lines but i'm having trouble accessing the UIAutomationValue.
please help

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

Re: uiautomationvalue

Post by odklizec » Tue Jul 26, 2016 9:50 pm

Hi,

Are you sure the UIAutomationValue is available for given repo element? If yes, try the following code...
repositoryText.Element.GetAttributeValueText("UIAutomationValue")
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

mander95
Posts: 66
Joined: Tue Jun 21, 2016 7:35 pm

Re: uiautomationvalue

Post by mander95 » Wed Jul 27, 2016 2:02 pm

got it, thank you