Re: [wtr-general] Re: how can I click an
@rajagopalan, I don't know enough about the internal workings of JavaScript or Webdriver to be sure. But my guess would be: - Browsers do not fully support click events for elements - eg https://stackoverflow.com/q/3487263/1200545 - As a result WebDriver has defined special logic simulating a click, which includes interacting with the select element - see definition https://www.w3.org/TR/webdriver/#element-click Justin On Friday, June 22, 2018 at 3:39:05 PM UTC-4, rajagopalan madasami wrote: > > Hi Justin, have you ever try to click option using JavaScript click, it is > not choosing as selenium click towards the option would choose the option . > But button click remain the same for both, do know why it is ? > > On 23-Jun-2018 1:06 AM, "Justin Ko" > > wrote: > > Do you try using the :id locator? It looks like you might have crossed > your attributes/values - ie the attempts are checking the "fielddisplayname" > attribute, but looking for the id value. > > Try: > > @browser.a(id: "Employee_ID").click > > If #click isn't working, you could also try #click! > > @browser.a(id: "Employee_ID").click! > > - Justin > > > On Friday, June 22, 2018 at 12:36:22 PM UTC-4, christina wrote: > >> Is not ok because all other attributes have the same link. >> >> I have to identify in a unique way. >> >> Please let me know how Thank you! >> >> On Fri, Jun 22, 2018 at 11:31 AM, c w wrote: >> >>> That worked: >>> >>> @browser.link(:class, "peoplefield editable editable-click >>> editable-empty").fire_event:click >>> >>> >>> >>> -- Forwarded message -- >>> From: c w >>> Date: Fri, Jun 22, 2018 at 11:03 AM >>> Subject: how can I click an >> on edit mode for a field >>> To: watir-...@googlegroups.com >>> >>> >>> >>> Hi all, >>> >>> Please help me and Thank you! >>> In order to edit these attribute I have to click on the "empty" which is >>> a javascript:; >>> >>> Please can one tell me how can I click on the Employee_id field to >>> edit... >>> If I will be able to do this tho others should be similar. >>> >>> I have try few things but these are not working: >>> @browser.a(fielddisplayname: "Employee_ID").click >>> @browser.a(fielddisplayname: "Employee_ID").fire_event:click >>> @browser.a(:class, ' peoplefield editable editable-click >>> editable-empty').click >>> >>> @browser.a(fielddisplayname: "Employee_ID").fire_event('onclick') >>> @browser.link(:xpath, "//a[@onclick='javascript:;']").click >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> -- > -- > 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. > > watir-...@googlegroups.com > http://groups.google.com/group/watir-general > watir-genera...@googlegroups.com > --- > 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 watir-genera...@googlegroups.com . > 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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- 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 watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [wtr-general] Re: how can I click an
Hi Justin, have you ever try to click option using JavaScript click, it is not choosing as selenium click towards the option would choose the option . But button click remain the same for both, do know why it is ? On 23-Jun-2018 1:06 AM, "Justin Ko" wrote: Do you try using the :id locator? It looks like you might have crossed your attributes/values - ie the attempts are checking the "fielddisplayname" attribute, but looking for the id value. Try: @browser.a(id: "Employee_ID").click If #click isn't working, you could also try #click! @browser.a(id: "Employee_ID").click! - Justin On Friday, June 22, 2018 at 12:36:22 PM UTC-4, christina wrote: > Is not ok because all other attributes have the same link. > > I have to identify in a unique way. > > Please let me know how Thank you! > > On Fri, Jun 22, 2018 at 11:31 AM, c w wrote: > >> That worked: >> >> @browser.link(:class, "peoplefield editable editable-click >> editable-empty").fire_event:click >> >> >> >> -- Forwarded message -- >> From: c w >> Date: Fri, Jun 22, 2018 at 11:03 AM >> Subject: how can I click an > on edit mode for a field >> To: watir-...@googlegroups.com >> >> >> >> Hi all, >> >> Please help me and Thank you! >> In order to edit these attribute I have to click on the "empty" which is >> a javascript:; >> >> Please can one tell me how can I click on the Employee_id field to edit... >> If I will be able to do this tho others should be similar. >> >> I have try few things but these are not working: >> @browser.a(fielddisplayname: "Employee_ID").click >> @browser.a(fielddisplayname: "Employee_ID").fire_event:click >> @browser.a(:class, ' peoplefield editable editable-click >> editable-empty').click >> >> @browser.a(fielddisplayname: "Employee_ID").fire_event('onclick') >> @browser.link(:xpath, "//a[@onclick='javascript:;']").click >> >> >> >> >> >> >> >> >> >> >> >> > -- -- 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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- 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 watir-general+unsubscr...@googlegroups.com. 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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- 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 watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[wtr-general] Re: how can I click an
Do you try using the :id locator? It looks like you might have crossed your attributes/values - ie the attempts are checking the "fielddisplayname" attribute, but looking for the id value. Try: @browser.a(id: "Employee_ID").click If #click isn't working, you could also try #click! @browser.a(id: "Employee_ID").click! - Justin On Friday, June 22, 2018 at 12:36:22 PM UTC-4, christina wrote: > > Is not ok because all other attributes have the same link. > > I have to identify in a unique way. > > Please let me know how Thank you! > > On Fri, Jun 22, 2018 at 11:31 AM, c w > > wrote: > >> That worked: >> >> @browser.link(:class, "peoplefield editable editable-click >> editable-empty").fire_event:click >> >> >> >> -- Forwarded message -- >> From: c w > >> Date: Fri, Jun 22, 2018 at 11:03 AM >> Subject: how can I click an > on edit mode for a field >> To: watir-...@googlegroups.com >> >> >> >> Hi all, >> >> Please help me and Thank you! >> In order to edit these attribute I have to click on the "empty" which is >> a javascript:; >> >> Please can one tell me how can I click on the Employee_id field to edit... >> If I will be able to do this tho others should be similar. >> >> I have try few things but these are not working: >> @browser.a(fielddisplayname: "Employee_ID").click >> @browser.a(fielddisplayname: "Employee_ID").fire_event:click >> @browser.a(:class, ' peoplefield editable editable-click >> editable-empty').click >> >> @browser.a(fielddisplayname: "Employee_ID").fire_event('onclick') >> @browser.link(:xpath, "//a[@onclick='javascript:;']").click >> >> >> >> >> >> >> >> >> >> >> >> > -- -- 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. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- 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 watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.