0

I am trying to click a web element if it is present and for that I am using the following code

Set btn = bot.FindElementById("F", Raise:=False)
If Not bot.FindElementById("F", Raise:=False) Is Nothing Then
    bot.FindElementById("F").Click
Else
End If 

but when I run the code I get the error

element not interact-able

QHarr
  • 83,427
  • 12
  • 54
  • 101
Dev
  • 25
  • 6
  • 1
    Can you share the url? Does it make a difference with a longer wait? And have a look through these explanations: https://stackoverflow.com/questions/44119081/how-do-you-fix-the-element-not-interactable-exception these detail other possibilities like another element obscuring your target. – QHarr Dec 01 '19 at 21:55
  • Thanx for responding. I am sorry for not being able to share URL as it is confidential. But the element is a radio button which occasionally comes on the page. What i want is want is that when it comes i may click it by above code and when it does not come my code should do nothing. But what actually happens is that when the element appears I am able to click the element . but then problem arises when the element do not appear on other occasion then it says element not found. Ideally it should pass without doing anything. Pls help – Dev Dec 02 '19 at 02:57
  • _element not found_ is not the same as _element not interactable_ If you have set btn into a variable why are you not testing if that variable is Nothing and clicking if not? _If Not btn Is Nothing Then btn.click_ ? – QHarr Dec 02 '19 at 07:48
  • I have tried the solution but when the radio button is not present I am again gettin msg element not visible. Elemen t is not interactable – Dev Dec 02 '19 at 16:48

0 Answers0