Basically on the UI there is a button that only becomes visible when hovered upon. I need to be able to click the Delete button when it's visible. Would be ideal if there was some way I can check that I am hovering the right thing by checking against the words Edit Test Contract 1: uib-tooltip="Edit Test Contract 1">
Html code:
<div class="ibox-content no-margins ">
<span tooltip-class="beacon-uib-tooltip" tooltip-append-to-body="true" uib-tooltip="Edit Test Contract 1">
<button class="name btn-link ng-binding ng-isolate-scope" ng-disabled="disableEdit()" mit-mini-modal="" ng-click="editContract(contract)">Test Contract 1</button>
</span>
<span class="icon-container hide-when-dragging">
<div class="show-when-hovering">
<span class="fa fa-times delete-icon ng-isolate-scope" uib-tooltip="Delete" tooltip-append-to-body="true" mit-mini-modal="" ng-click="deleteContract()"></span>
The python code I have atm returns nothing for some reason despite me searching for the right css, ng-click="deleteContract()". The method by which I am attempting to click on the delete button is delete_contract(). Please let me know if you require any more information, I've tried to be as detailed as possible.
class Locator:
def __init__(self, selenium_context, short_wait_time_sec):
self.selenium_context = selenium_context
self.short_wait_time_sec = short_wait_time_sec
def find_elements_css(self, cssSelector):
return self.selenium_context.find_elements_by_css_selector(cssSelector)
def delete_contract(self, contract_name):
self.contract_list = self.page_loc.find_elements_css('button[ng-click="deleteContract()"]')
for contract in self.contract_list:
if contract.text == contract_name:
contract.click()
break