Forum Discussion

Semirxbih's avatar
Semirxbih
Contributor
7 months ago

select.ClickItem selecting wrong dropdown value

Hey all,

So I am working on Automation Scripting for my employer and we are currently on "Version: 15.53.2.7" of SmartBear and not being able to upgrade just yet. We all got forced to upgrade to v120 of Microsoft Edge.

Currently, I am running into an issue where select.clickItem() is selecting the wrong dropdown value and I tried multiple different methods to fix it, but I am unsuccessful, so wanted to reach out and see if anyone might have some advice.

So let's say that I have the following code: configList = aqObject.GetPropertyValue(select, "ContentText");

This returns:
Import
Import Existing Config
Import_1
Import_11
Import_1_v1-0-0
Import_3
Import_GCT_1290
Import_v1_0
ImportTest

Then I have the following code, which pattern matches my configName and looks for it in the configList:
    var escapedConfigName = configName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    var pattern = "\\b" + escapedConfigName + "\\b";
    var regex = new RegExp(pattern);
    if (regex.test(configList)) {
        select.ClickItem(configName);
    } else {
        Log_Message("Configuration not found: " + configName, STEP_WARN);
    }

escapedConfigName is Import_1_v1-0-0.

It finds the dropdown and when it selects it, the dropdown value is selected as ImportTest.

I have seen that there are major issues with ClickItem, but has anyone found a workaround possibly?

2 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    There's no workaround, the issue is with ClickItem method. The issue has been fixed in the latest version 15.61, and verified against the latest version of Chrome. It should also work with Edge. 

    • Semirxbih's avatar
      Semirxbih
      Contributor

      Thanks rraghvani - I will notify my team that code will be in backlog until they upgrade to the latest 15.61 version.