Error :javascript error: $ is not a function [message #1831675] |
Wed, 26 August 2020 07:04  |
Eclipse User |
|
|
|
Hi,
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.io.File;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import ru.yandex.qatools.ashot.AShot;
import ru.yandex.qatools.ashot.Screenshot;
public class ImageScreenshot {
//WebDriver imported from : org.openqa.selenium.WebDriver;
static WebDriver driver;
public static void main(String[] args) throws Exception {
System.setProperty("webdriver.chrome.driver", "G:\\selenium\\Chrome Drivers\\chromedriver_win32 (1)\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
WebElement webElement = driver.findElement(By.id("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 82 times)
|
|
|
Re: Error :javascript error: $ is not a function [message #1831703 is a reply to message #1831675] |
Thu, 27 August 2020 02:27  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.07720 seconds