[Arguments] ${card_name}
Wait Until Element Is Visible ${loc} ${short_time}
@{Locators_common} = Get WebElements ${loc_}
Click Element ${Locators_common}[${card_name}]
Wait Until Element Is Visible ${loc_Validation} ${short_time}
hi i am new at robot framework
i want to used element from locator_common list on the basic of their index so
when i used click element and pass ${Locators_common}[${card_name}] that time ElementNotInteractableExceptionexcepation showd ho to deal it ?
Error your receiving is thrown to indicate that although an element is present on the HTML DOM, (which would suggest the locator looks to be valid) but it suggests it is not in a state that can be interacted with. And the âWait Until Element Is Visibleâ is a good start and should normally resolve the issue in most, could you confirm if the element youâre wanting to âClickâ is out of view on load? as you may have to scroll this into view before interacting with it, this can be achieved with the below as something to try
SeleniumLibrary: Scroll Element Into View ${Locators_common}[${card_name}]
You could wrap that in [Run Keyword And Ignore Error ] which is part of the built-in library, depending on your error handling
But in terms of fully understanding where the issue may be sharing the log for where itâs falling over and possibly a snippet of the dom for the element youâre trying to click, could be helpful in helping you if the above doesnât resolve where the exception is thrown.
thanks
but after used Scroll Element Into View ${Locators_common}[${card_name}]
same exception will showed ElementNotInteractableException: Message: element not interactable:
â Are you able to provide a snippet of the dom and RF logs for where itâs falling over, if itâs a public site then providing the Url and for which element youâre having trouble would be helpful as mentioned⌠â
But, Iâm almost certain the problem is this below in bold as it will be by index youâll need to use to return that item (element) from the list of elements, and then do some form of a check to make sure its the correct element you want to interact with, based on whatâs been given:
@{Locators_common} = Get WebElements ${loc_}
Click Element ${Locators_common}[${card_name}]
Hard not to guess when thereâs not much given but it will be a 0-based index, and not knowing what âcard_nameâ holds, could be 0+ or a string valueâŚ
I guess there are a number of things you could do, if all cards use the same/part locator + ${card_name} you can remove the line of @{Locators_common} = Get WebElements ${loc_} and then, set a common variable for ${cards_common}, then do the below:
Click Element ${cards_common}//*[@text='${card_name}']
Youâll just need to figure out what that common part is, the dom is a good place to figure out what that common XPath may look like.