If activity based on website drop down

Hello Everyone. I’m trying to build an if/then sequence from a web drop down element and I’m not having much luck with it even after following several other post here.

It works like this. If the drop down menu is already on the correct item then save the page and continue on with the next. but if it’s not already correct change it to the correct option and then save and continue on.

This is how I have it setup:

This is the error I’m getting:
Source: Select Item ‘SELECT ctl00_main_reit…’ (Select Item ‘SELECT ctl00_main_reit…’)
Message: The UiElement is not initialized
Exception Type: UiPath.Core.UninitializedNodeException

Any help is greatly appreciated!

~James

1 Like

Just figured it out. I didn’t have the if sequence inside the attach browser. Moved it and it works fine now.

Except now it won’t save the page…

1 Like

Are you unable to save the page if the dropdown option is not updated?

You could use the “Get Text” activity on the dropdown to compare the current value with your (soon to be) new dropdown value. If they’re the same, you won’t have to change the value or save. If they’re different, update and save.

If i copy the Save activity and paste it under the IF activity it will make the change if the text is not correct then save the page. If the text is already the same the bot ends but doesn’t save the page. It’s like the Then condition is being ignored.

Would you have an example of the Get Text activity?

For “Get Text” you just have to specify the element you want it to read the text from and it will output into a string variable.

I changed the Get Attribute selector to “text” and this fixed it. It was defaulting to the Else statement no matter what.

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