That's pretty much it. The driver attempts to determine if a user would be able to click the element, and if it can it clicks it, and if it can't, it throws the error based on the reason the algorithm found (Click Intercepted, Element not Interactable, Not Displayed, etc).
Sometimes the way the devs have created the UI, the driver doesn't think a user can do the thing that it is being told to do. Sometimes it works to click on the parent of the element you want, sometimes it makes sense to make a call to enact the click event handler directly ( https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onclick) using JavaScript On Mon, Jun 18, 2018 at 2:23 PM rajagopalan madasami < [email protected]> wrote: > Can you explain me the difference between selenium click and JS click if > any? I know selenium click can only be performed if element is visible on > the other hand JS click can be even if element is not visible. Is there any > other difference do you know? > > On Tue 19 Jun, 2018, 12:49 AM Titus Fortner, <[email protected]> > wrote: > >> cristina, >> >> Yes, sometimes front end developers like to cover up or override default >> interactions with the underlying html elements, and using javascript >> becomes a necessary way to overcome that. >> >> Note that this does the same thing, but might be slightly easier to read: >> `@manage_web_portal_page.checkbox(id: 'pageProfile').click!` >> >> >> On Mon, Jun 18, 2018 at 12:44 PM Jeff Fagot <[email protected]> wrote: >> >>> The checkbox appears to always be checked. >>> So instead I would rather look up 2 divs and compare the class: >>> >>> <div class="bootstrap-switch bootstrap-switch-wrapper >>> bootstrap-switch-id-pageProfile *bootstrap-switch-off* >>> bootstrap-switch-animate"> >>> vs >>> <div class="bootstrap-switch bootstrap-switch-wrapper >>> bootstrap-switch-id-pageProfile *bootstrap-switch-on* >>> bootstrap-switch-animate"> >>> >>> I guess the checkbox itself can be used to switch but not for >>> determining the Value to where it is set to, if that makes sense. >>> >>> Hope that helps. >>> >>> JFF >>> >>> On Monday, June 18, 2018 at 8:33:19 AM UTC-4, christina wrote: >>>> >>>> Hi Jeff, >>>> >>>> do not say sorry, I try all my best to make things working but I am not >>>> confident that I can use another way... >>>> >>>> Here is a screen snapshot when I inspect the Off "button" which in fact >>>> is a check box >>>> >>>> >>>> >>>> >>>> >>>> and this is when I have the button ON >>>> >>>> >>>> >>>> >>>> >>>> If there is another way to click it it please advise me. >>>> Thank you! >>>> >>>> >>>> On Fri, Jun 15, 2018 at 8:02 PM, Jeff Fagot <[email protected]> wrote: >>>> >>>>> Sorry for my inappropriate answer as I came to see you found the >>>>> element. >>>>> Have you tried to run it with a sleep time? >>>>> >>>>> Does the screenshot of your error matches the scenario you have given >>>>> us? Are you seeing only one yes printing?? >>>>> >>>>> >>>>> On Friday, June 15, 2018 at 7:36:00 PM UTC-4, Jeff Fagot wrote: >>>>>> >>>>>> The error message indicates specifically what element is obscuring >>>>>> the one you are trying to click on. >>>>>> You can look it up : <span class="bootstrap-switch-handle-on >>>>>> bootstrap-switch-primary"> >>>>>> >>>>>> >>>>>> -- >>>>> -- >>>>> Before posting, please read >>>>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >>>>> >>>>> In short: search before you ask, be nice. >>>>> >>>>> [email protected] >>>>> http://groups.google.com/group/watir-general >>>>> [email protected] >>>>> --- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Watir General" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> -- >>> Before posting, please read >>> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >>> >>> In short: search before you ask, be nice. >>> >>> [email protected] >>> http://groups.google.com/group/watir-general >>> [email protected] >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Watir General" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> -- >> Before posting, please read >> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >> >> In short: search before you ask, be nice. >> >> [email protected] >> http://groups.google.com/group/watir-general >> [email protected] >> --- >> You received this message because you are subscribed to the Google Groups >> "Watir General" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > -- > -- > Before posting, please read > https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. > > In short: search before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected] > --- > You received this message because you are subscribed to the Google Groups > "Watir General" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
