Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Error :javascript error: $ is not a function(While executing compare two images script using AShot())
Error :javascript error: $ is not a function [message #1831675] Wed, 26 August 2020 11:04 Go to next message
Saikiran Sikhakolli is currently offline Saikiran SikhakolliFriend
Messages: 1
Registered: August 2020
Junior Member
I am trying to execute the code of compare two images by using AShot(). Please me a suggestion how to solve this problem.
I am using Eclipse IDE for Java Developers - 2019-12
Java 1.8 version,chrome version 84

please refer the attachment below Consle

import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class ImageScreenshot {

//WebDriver imported from : org.openqa.selenium.WebDriver;
static WebDriver driver;
public static void main(String[] args) throws Exception {

System.setProperty("", "G:\\selenium\\Chrome Drivers\\chromedriver_win32 (1)\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
WebElement webElement = driver.findElement("site-logo"));
System.out.println("Image get from location");
Screenshot screenshot = new AShot().takeScreenshot(driver,webElement);
ImageIO.write(screenshot.getImage(), "PNG", new File(System.getProperty("G:\\Selenium-WorkSpace\\Everything\\images\\LogoImage.png")));


  • Attachment: Console.png
    (Size: 143.40KB, Downloaded 14 times)
Re: Error :javascript error: $ is not a function [message #1831703 is a reply to message #1831675] Thu, 27 August 2020 06:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31863
Registered: July 2009
Senior Member
You're no doubt better off to ask on a forum dedicated to the framework you are using in this code sample. This forum is for asking questions about the Java Development Tools themselves and unless someone reading this forum actually knows something about this specific framework you are using, you're unlikely to get an answer here.

Ed Merks
Professional Support:
Previous Topic:Plugin could not be resolved (with config tag)
Next Topic:Tomcat server prints severe warning at start
Goto Forum:

Current Time: Mon May 10 08:39:17 GMT 2021

Powered by FUDForum. Page generated in 0.01785 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top