Unable to compare string and select dropdown values

Hi guys,

I am trying to select a currency value from a list of dropdowns. The problem is that my input in in abbreviation and values in dropdown are in expanded form. So now my work flow is as below:

I am getting the following message as error: Select Item ‘SELECT from’: Cannot select item. It was not found among existing items.
TIP: Some combo-boxes delay load items until its dropdown is expanded. Try to simulate a click on control prior to selecting an item.

But even after adding a click activity I am getting the same error. Please help…

Note: My input value is USD and dropdown value in United States Dollar (USD)

1 Like

@Santa_Krish - You can use Click activity followed by Send Hotkey activity OR you can try Type Into activity.

I am unable to use type into or hotkey activities since the dropdown doesn’t allow it. ie I directly cant type USD since it will allow only the first letter (U)

1 Like

@Santa_Krish
In such scenario find children can help:

  • let point the find children selectro to the dropdown
  • define a filter to the selectitems (options in case of html dropdowns)

with a later processing the USD selectItem can be identified (e.g. contains, startsWith…) and be used e.g.

  • uielement is passed to click activity
  • uilement.Get(attributename) can be used for select item

Your screenshot shows that you already have experimented with find children, but not all is shown, so its not clear in all what was done.

Another strategy could be following:

  • As the different currency entries are limited you can define e.g. a mapping dictionary:
  • key:“USD”, Value: “United States Dollar (USD)”

so with the input of USD the mapping dicitionary can be used in a select item like this: dictCurrencyVariable(“USD”)

Hi @ppr, I have attached the workflow with the implementation that you had suggested, but still got the same error that i had mentioned previously. Please let me know if any changes are to be madeCurrency Conversion.xaml (14.1 KB)

@Santa_Krish
I had a look on your XAML. As far as the implemented steps are derivable you were a little but mis/unusing the find children activity and it has a look that different approaches were mixed up.

As the currency selection is used two times the mapping dictionary approach is one of many other possible solutions:

  • find all selectitems with find children (Selector indicated to DropDown, Filter configured to SelectItems)
  • iterate over all retrieved options
    • get SelectItem Text with get attribute on innertext
    • regexing to retrive the code within ( )
    • Adding it to the mapping dictionary

the form interaction could look like this and is aligned to your implementation with arguments:
grafik

with the code from the in Arguments the selectItem Text were retrieved from mapping dictionary

Find Demo XAML(Firefox, internetexplorer was Not loading the Page) here: Currency_Conversion_G2.xaml (23.5 KB)

Let us know your feedback. We would encourage you on continue the work in a modularized way as you already have started with the use of in and out arguments. For a batch conversion the mapping dict could be created only 1 tim on start and then passed as arguments was well.

2 Likes

Thanks ppr, As per your suggestion was able to create dictionary and carryout currency conversion successfully. Thanks a ton!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.