I have the below function. It always says the text does not match. This is within test complete. I have put a watch on both items and both dont contain any white spaces. I am new to this but wondered if there is anything obvious I am doing wrong?
function VerifyComboBox(/*formcontrolname, value*/)
{
var formcontrolname = "CassetteTypeFilter";
var value = "Filter By Cassette Type";
try{
/*Boolean condition is declare either to execute code or not*/
if (formcontrolname && value !== null)
{
/*convert String to object */
var name = ConvertToObject(formcontrolname);
object=Sys.Browser("*").Page("*").FindChildByXPath("//*[@formcontrolname='" + name + "' and contains(., '" + value + "')]");
/*Waits until object appears*/
waitUntilObjectIsVisible("//*[@formcontrolname='" + name + "']");
/*scrolll to the invisble element*/
object.ScrollIntoView();
var visibleText = object.innerText.replace(/▼/g,'')
/*Boolean conditions to check the value of the element*/
if (visibleText == value) {
Log.Checkpoint("Text matches");
}
else {
Log.Error("Text does not match");
}
}
}
catch (e)
{
// Posts an exception message to the test log`enter code here`
Log["Error"]("EXCEPTION OCCURED: " + e["description"]);
}
}

visibleTextandvalueat the time ofif (visibleText == value) {? - What doesconsole.log(visibleText)andconsole.log(value)show you?