jeudi 20 février 2020

python selenium, click on toolbar element

I have a question, I'm developing test automation and I want to click on element located in toolbar,I'm using python and selenium. Here is a code of website

<dl class="ToolbarDropdown_menu_2wY9X ToolbarDropdown_isHidden_3UaGr" tabindex="0" style="" 
xpath="1"><dt><span class="ToolbarDropdown_title_1NBVn">New</span>
<span class="DropdownArrow_arrowIcon_dDzph DropdownArrow_down_3dlvo"></span>
</dt>
<dd class="ToolbarDropdown_item_nP-_M" style="">Dataset</dd>
<dd class="ToolbarDropdown_item_nP-_M">Project</dd>
</dl>

I need to click on element with text Dataset.

I locate element in this way

DATASET_BUTTON = (By.XPATH, '//dd[contains(text(),"Dataset")]')

And I want to perform action like that

self.driver.find_element(*VideosPageLocator.DATASET_BUTTON).click()

And there is no action but in terminal looks like my step has passed. Do you have any idea how to click on element in dropdown?

Aucun commentaire:

Enregistrer un commentaire