selenium exception

20 views
Skip to first unread message

Ananya Sarkar

unread,
May 3, 2018, 3:04:17 AM5/3/18
to seleniu...@googlegroups.com
how to resolve 

elementclickinterceptedexception.

when multiple elements are present with same attribute and there is no specific attribute to find the element. Xpath and css selector doesnot help.

intercept.png
application with attributes.png

Jonathan Herbaut

unread,
May 3, 2018, 3:23:09 AM5/3/18
to seleniu...@googlegroups.com
Your exception tells you that another IWebElement is targetted by your search. "button" class is obviously too common in your code. Try to combine this class with another one around your target. It's seems that "clsaddbtn" can do the job but I'm sure you will need another one again because I see somes tabs in your browser that maybe hide the same classes.
You can look to PageObject model and use FindBySequence to reach your element.
And another point : Thread.Sleep is evil. If you must wait for your elements, you can use Selenium Wait, because if your server is busy, you will have free exception because your Thread.Sleep will not be enough, and maybe your Thread.Sleep is already too long and you are waiting for nothing.

[FindsBySequence]
[FindsBy(How = How.Id, Using = "elementId", Priority = 0)]
[FindsBy(How = How.Id, Using = "childElementId", Priority = 1)]
public IWebElement thisElement;

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CABA-N%2BWkYTDHhPisjP2L3MvLptvX_BPLDir8uqNX1Nry5qUhFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Rakesh das

unread,
May 3, 2018, 4:17:32 AM5/3/18
to seleniu...@googlegroups.com
Hi Buddy
Try to implement javascriptExcutor, check it might be work on your case

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Ankit Gupta

unread,
May 3, 2018, 4:17:45 AM5/3/18
to seleniu...@googlegroups.com
There could be more button with have class name as "Button"

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages