ElementNotVisibleException: Message: element not interactable in Robot Framework
The desired element is within a Modal Dialog Box so you need to induce WebDriverWait for the element to be visible/enabled and you can use either/both (clubbing up) of the following solutions:
Wait Until Element Is Visible
:Request approveSelenium2Library.Click Element &{Landing}[reqApprove]Sleep 2sSelenium2Library.Click Element &{Landing}[cofReq]Sleep 2sSelenium2Library.Wait Until Element Is Visible xpath=//button[@class="btn btn-primary btn-block" and @id="btn_close_modal"] timeout=20sSleep 3sSelenium2Library.Click Element xpath=//button[@class="btn btn-primary btn-block" and @id="btn_close_modal"]
Wait Until Element Is Enabled
:Request approveSelenium2Library.Click Element &{Landing}[reqApprove]Sleep 2sSelenium2Library.Click Element &{Landing}[cofReq]Sleep 2sSelenium2Library.Wait Until Element Is Enabled xpath=//button[@class="btn btn-primary btn-block" and @id="btn_close_modal"] timeout=20sSleep 3sSelenium2Library.Click Element xpath=//button[@class="btn btn-primary btn-block" and @id="btn_close_modal"]
You can find a detailed discussion about
Wait Until Element Is Visible
andWait Until Element Is Enabled
in Robotframework: Selenium2Lib: Wait Until (…) KeywordsReference: Selenium2Library
try using this,
Click Element //button[@id='btn_close_modal']
or try using java script executor,
Wait Until Page Does Not Contain NOBODY SELECTEDExecute JavaScript $("#btn_close_modal").click();