I'm writing a test which needs to store password inside the browser for a dumb site and I'm performing this task with Selenium Python.
I'm able to load chrome://settings/passwords
without problem.
The task requires to click the "Add" button and fill the form with dumb data if they are not present. The problem which I am facing is the selection of the button or any other element of the settings page.
This is the HTML element of the button:
<cr-button id="addPasswordButton" title="Add new password" role="button" tabindex="0" aria-disabled="false">
Add
The idea I had was to select it with one of these options:
btn = web_driver.find_element(By.ID, "addPasswordButton")
btn = web_driver.find_element(By.XPATH, "//*[@id='addPasswordButton')]")
but both returns:
RtlGetAppContainerNamedObjectPath [0x773C7B3E+238]
The same error with any other element in the page, exept the settings-ui
at top level.
I've also tryed to select elements based on the tag name, which seems quite custom, but nothing.
Also searching the error has not given any clue for scarcity of results. It seems to me that the settings page is build with nested subpages and that Selenium is not able to inspect them.
I've also tryed to switch to the inner page without results:
a = web_driver.find_element(By.XPATH, "//settings-ui")
web_driver.switch_to(a)
leads to:
{TypeError}TypeError("'SwitchTo' object is not callable")
Is there a way to solve this issue and being able to select an element which is also provided with an unique ID?