Add variable in selector

Hi,

I am trying to add variable in selector but am getting selector not found exception.

Original:

<webctrl aaname='Brio ' tag='DIV' />

i have tried like below :
<webctrl aaname='" +modelName+ "' tag='DIV' />

image

@Lawrance_A Try once modelName.ToString

When you use variable in selector do not open the Selector Editor and paste directly in Selector textbox then the popup will look like

image

another easier way is to delete the selector in “Edit Selector” option.
Then, when you try an edit, you will get a blank text box.
Paste:
“<webctrl aaname=’” +modelName+ “’ tag=‘DIV’ />”

image

image

what type of variable is modelName?

Generic Value

i am taking content from excel using for each row

Try: you can convert using convert.ToString(modelName).

i already converted to string also can you check my xaml once ?

OE_Competition Report(Autosaved).xaml (228.6 KB)

Any issue when you are running the workflow?

Yes, am getting below error

i will need your excel as well

Try this. Not everything applies to you. But check out the way to enter dynamic selector in the selector field

The issue is not with respect to your selector any more. Please share your excel once and i will try and debug through it

Honda List.xlsx (8.0 KB)
Here you go !
Thanks for your time.

Hi,
If you looking for the dynamic selector. First assign the whole selector into a variable, and place the variable in the selector field…

H Akil,

I tried your idea its working partially - i tred message box to read the selector its giving correct selector with model name but am getting below error in next activity.


OE_Competition Report(Autosaved).xaml (229.7 KB)

Issues:

  1. You copy and pasted the code that is why the " " quotes were not correct
  2. The value in your excel is all caps and the one on the web page is propercase
  3. A slight wait for the first box to collapse to be able to select the second one

Hope it helps
Keep Automating

1 Like