Capture arguments of onclick() javascript call using Selenium Java



  • I am writing a selenium script in Java to capture the arguments passed in JavaScript onclick() call/method. Attached is the image in which method/function name is highlighted. enter image description here

    Now, In this method there are some arguments/parameters which i want to capture same as we capture any css_Selector. I am unable to do this. Is there any method or way to do this task? In the Below attached image, i want to capture arguments such as "content_ids", "content_type", "value", "currency" and "content_name". Kindly suggest me solution. enter image description here



  • see how-to-get-the-contents-of-a-script-tag-in-selenium

    element.GetAttribute("innerHTML"); could help you here



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2