Forum Discussion

TCVV's avatar
TCVV
Occasional Contributor
12 months ago

Issue - since upgraded to 15.51 - test script not picking up the correct item from the list box.

Same script work well in 14.9 version but not in 15.51 selecting the correct item from the list box.

'OptionValue' is what we are passing as parameter, but instead it picks up wrong item from the list box.  This works perfectly well in 14.9 version of Testcomplete!

 

Here is my test script:

function SetValueForDropDown(DropDownLabel, ValueToFind, OptionValue)
{
Options["Run"]["ObjectSearchStrategy"] = "Depth-first";
var AllObjects = Sys.Browser("chrome")
Indicator["PushText"]("Locating drop-down list.")
var DropDownList = AllObjects["FindChild"](DropDownLabel, ValueToFind, 100, true)
var acc = 0
while(DropDownList.Exists == false && acc < 5)
{
Delay(1000)
Sys.Browser("chrome").Refresh()
var DropDownList = AllObjects["FindChild"](DropDownLabel, ValueToFind, 100000, true)
acc++
}
if(DropDownList.Exists == true)
{
Indicator["PushText"]("Operating the drop-down to select options.")
DropDownList.ClickItem(OptionValue)
}
else
{
Log["Error"]("Drop-down List " + ValueToFind + "Not Found")
}
}