Recently updated the outer html and encountered a new error. It appears that the element was identified but failed to be clicked on.
My script fails at the element below. I have attempted various methods to reconstruct the xpath, but the robot continues to fail due to DOM invalidity.
Original element:
<div class="ant-select SearchPrompter_advInput__3P9Jf ant-select-multiple ant-select-allow-clear ant-select-show-search">
<div class="ant-select-selector">
<div class="ant-select-selection-overflow">
<div class="ant-select-selection-overflow-item ant-select-selection-overflow-item-suffix" style="opacity: 1;">
<div class="ant-select-selection-search" style="width: 3px;">
<input autocomplete="off" type="search" class="ant-select-selection-search-input" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_2_list" aria-autocomplete="list" aria-controls="rc_select_2_list" aria-activedescendant="rc_select_2_list_0" value="" id="rc_select_2" style="opacity: 0;" aria-expanded="false" readonly="" unselectable="on">
<span class="ant-select-selection-search-mirror" aria-hidden="true"> </span>
</div>
</div>
</div>
<span class="ant-select-selection-placeholder">Select Source(s)</span>
</div>
</div>
Script:
*** Settings ***
Library Browser
Library OperatingSystem
Resource ../Resources/BrowserParameters.robot
Resource ../Resources/BrowserResources.robot
Resource ../Resources/BrowserCustomKeywords.robot
#Select Browser: chromium or firefox
Test Setup Test Setup Browser=chromium
Test Teardown Test Teardown
*** Test Cases ***
001
Click //span[contains(@class,'ant-select-selection-placeholder') and contains(text(),'Select Source(s)')]
Error
FAIL
Message: TimeoutError: locator.click: Timeout 10000ms exceeded.
=========================== logs ===========================
waiting for selector "//span[contains(@class,'ant-select-selection-placeholder') and contains(text(),'Select Source(s)')] >> nth=0"
selector resolved to hidden <span class="ant-select-selection-placeholder">Select Source(s)</span>
attempting click action
waiting for element to be visible, enabled and stable
element is not stable - waiting...
element is visible, enabled and stable
scrolling into view if needed
done scrolling
checking that element receives pointer events at (1080.4,304.7)
<div class="ant-select-selection-overflow">…</div> intercepts pointer events
retrying click action, attempt #1
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
checking that element receives pointer events at (1080.4,304.7)
[ Message content over the limit has been removed. ]
element is visible, enabled and stable
scrolling into view if needed
done scrolling
checking that element receives pointer events at (1080.4,304.7)
<div class="ant-select-selection-overflow">…</div> intercepts pointer events
By using this code, I am able to access the field and see the list being displayed. However, there are two fields in the form that use the same xpath. The robot accesses the first field, but I actually want it to go to the next field.
Click //div[@class="ant-select SearchPrompter_advInput__3P9Jf ant-select-multiple ant-select-allow-clear ant-select-show-search"]