Page 1 of 1

uiautomationvalue

Posted: Tue Jul 26, 2016 9:38 pm
by mander95
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

Re: uiautomationvalue

Posted: Tue Jul 26, 2016 9:50 pm
by odklizec
Hi,

Are you sure the UIAutomationValue is available for given repo element? If yes, try the following code...
repositoryText.Element.GetAttributeValueText("UIAutomationValue")

Re: uiautomationvalue

Posted: Wed Jul 27, 2016 2:02 pm
by mander95
got it, thank you