Search code examples
javascriptjavaseleniumjsoup

How to read Jquery Version from Chrome browser console for webpages and write in eclipse Java console through selenium


How to read Jquery Version from Chrome browser console for webpages and write in eclipse Java console through selenium.

Command: $. ui. version

enter image description here


Solution

  • You can use either of the following commands within the console:

    • $().jquery;
    • $.fn.jquery

    Snapshot:

    jQuery_version


    Programmatically

    To redirect the version within the browser console you can use the following solution:

    • Code Block:

      driver.get("https://jquery.com/")
      print(driver.execute_script("return $().jquery;"))
      print(driver.execute_script("return $.fn.jquery"))
      
    • Console Output:

      1.11.3
      1.11.3