RobotFramework: Link/List with locator not found

I am studying Robot Framework with Selenium Library and I canโ€™t figure out how to remove โ€œkwโ€ element from the next dropdown:

enter image description here

I tried to use xpath for it:

*** Settings ***
Library  SeleniumLibrary

*** Test Cases ***
MyTest
  Create Webdriver  Chrome  executable_path=chromedriver.exe
  Open Browser  http://127.0.0.1:85/  Chrome
  Sleep  10
  Click Link  xpath=//body/div[@id='react-entry-point']/div[@id='_dash-global-error-container']/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/span[1]

But it doesnโ€™t work. I am getting:

Link with locator 'xpath=//body/div[@id='react-entry-point']/div[@id='_dash-global-error-container']/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/span[1]' not found.

If I try //span[text()='kw'] or //span[contains(.,'kw')] or //div[@class='Select-value']//span[contains(.,'kw')] I would get the same error.

Also I tried to access to this element via List by Value instead of Click Link:

  Unselect From List by Value  xpath=//body/div[@id='react-entry-point']/div[@id='_dash-global-error-container']/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/span[1]

But I am getting an error:

List with locator 'xpath=//body/div[@id='react-entry-point']/div[@id='_dash-global-error-container']/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/span[1]' not found.

Here is HTML code for dropdown menu:

  <div style="display: inline-block; height: 20px; width: 300px; margin-left: 25px;" xpath="1"><div id="Type_id" class="dash-dropdown"><div class="Select has-value is-clearable is-searchable Select--multi"><div class="Select-control"><div class="Select-multi-value-wrapper" id="react-select-2--value"><div class="Select-value"><span class="Select-value-icon" aria-hidden="true">ร—</span><span class="Select-value-label" role="option" aria-selected="true" id="react-select-2--value-0">kw<span class="Select-aria-only">&nbsp;</span></span></div><div class="Select-value"><span class="Select-value-icon" aria-hidden="true">ร—</span><span class="Select-value-label" role="option" aria-selected="true" id="react-select-2--value-1">teardown<span class="Select-aria-only">&nbsp;</span></span></div><div class="Select-value"><span class="Select-value-icon" aria-hidden="true">ร—</span><span class="Select-value-label" role="option" aria-selected="true" id="react-select-2--value-2">setup<span class="Select-aria-only">&nbsp;</span></span></div><div class="Select-input" style="display: inline-block;"><input id="Type_id" aria-activedescendant="react-select-2--value" aria-expanded="false" aria-haspopup="false" aria-owns="" role="combobox" value="" style="box-sizing: content-box; width: 5px;"><div style="position: absolute; top: 0px; left: 0px; visibility: hidden; height: 0px; overflow: scroll; white-space: pre; font-size: 15px; font-family: &quot;Open Sans&quot;, HelveticaNeue, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-weight: 400; font-style: normal; letter-spacing: normal; text-transform: none;"></div></div></div><span aria-label="Clear all" class="Select-clear-zone" title="Clear all"><span class="Select-clear">ร—</span></span><span class="Select-arrow-zone"><span class="Select-arrow"></span></span></div></div></div></div>

Here is a link to full HTML code:
https://jsfiddle.net/illuminato/u24j6wbh/

Thank you in advance!

Finally I got a solution:

Click Element   //span[text()='kw']/../*[@class="Select-value-icon"]
1 Like