Org.openqa.selenium.JavascriptException: javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite. | Selenium Forum
S
Samir Shandilya Posted on 20/02/2020

Hello Everyone,

 

This code was running fine, suddenly throwing exception

org.openqa.selenium.JavascriptException: javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite.

 

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.Wait;
import org.openqa.selenium.support.ui.WebDriverWait;

public class TransactionTest {

private static WebElement element = null;

public static void main(String[] args) throws Exception {

System.setProperty("webdriver.chrome.driver", "D:\\Jar\\WebDriver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();

Actions humanInteraction = new Actions(driver);
/* driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); */

driver.get("https://sportshub.ivendhq.com/Account/Login");
driver.manage().window().maximize();

WebElement usr = driver.findElement(By.name("usernameOrEmailAddress"));

WebElement pwd = driver.findElement(By.xpath("//input[@type='password']"));

usr.clear();
usr.sendKeys("samir.shandiliya@citixsys.com");
pwd.clear();
pwd.sendKeys("sammy@123");
humanInteractionWait();
WebElement login = driver.findElement(By.xpath("//button[text()='Log in']"));
login.click();
humanInteractionWait();
driver.get("https://sportshub.ivendhq.com/Mpa/QuickSetup");

driver.findElement(By.xpath("//a[text()='Products']")).click();
driver.findElement(By.xpath("//*[@id='Product']/a")).click();
driver.findElement(By.xpath("//*[@id='CreateNewProductButton']")).click();
//humanInteractionWait();
driver.findElement(By.xpath("//input[@name='Description']")).sendKeys("Cricket Pads");
driver.findElement(By.xpath("//*[@id='collapseOne']/div[1]/div[5]/div[1]/span/span/span")).click();
humanInteractionWait();
driver.findElement(By.xpath("//li[text()='Items']")).click();
humanInteractionWait();
WebElement wb = driver.findElement(By.xpath("//input[@id='BasePrice']"));
((JavascriptExecutor)driver).executeScript("arguments[0].removeAttribute('style')",wb);
wb.sendKeys("300");
humanInteractionWait();
humanInteractionWait();
humanInteractionWait();
driver.findElement(By.xpath("//div[@id='InventorySettings']/div[1]/h4/a/span/i")).click();
humanInteractionWait();
humanInteractionWait();
humanInteractionWait();

WebElement wbe = driver.findElement(By.xpath("//*[@id='InventoryGrid']/table/tbody/tr/td[2]"));
humanInteractionWait();
humanInteractionWait();
humanInteractionWait();
humanInteraction.click(wbe).build().perform();   //Exception is coming on this line
humanInteractionWait();
humanInteractionWait();
humanInteractionWait();
humanInteraction.sendKeys(wbe, "35").build().perform();
humanInteractionWait();
humanInteractionWait();
humanInteractionWait();
driver.findElement(By.xpath("//button[@id='SaveButton']/span")).click();

}

public static void humanInteractionWait() throws Exception {
Thread.sleep(5000);
}

}

 

Please help me to solve this issue..

 


A
Ashish Thakur Replied on 21/02/2020

Please refer the below code

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;

public class TransactionTest {
	private static WebElement element = null;

	public static void main(String[] args) throws Exception {
		System.setProperty("webdriver.chrome.driver", "D:\\Jar\\WebDriver\\chromedriver.exe");
		WebDriver driver = new ChromeDriver();
		Actions humanInteraction = new Actions(driver);
		driver.get("https://sportshub.ivendhq.com/Account/Login");
		driver.manage().window().maximize();
		WebElement usr = driver.findElement(By.name("usernameOrEmailAddress"));
		WebElement pwd = driver.findElement(By.xpath("//input[@type='password']"));
		usr.clear();
		usr.sendKeys("samir.shandiliya@citixsys.com");
		pwd.clear();
		pwd.sendKeys("sammy@123");
		humanInteractionWait();
		WebElement login = driver.findElement(By.xpath("//button[text()='Log in']"));
		login.click();
		humanInteractionWait();
		driver.get("https://sportshub.ivendhq.com/Mpa/QuickSetup");
		driver.findElement(By.xpath("//a[text()='Products']")).click();
		driver.findElement(By.xpath("//*[@id='Product']/a")).click();
		driver.findElement(By.xpath("//*[@id='CreateNewProductButton']")).click();
//		humanInteractionWait();
		driver.findElement(By.xpath("//input[@name='Description']")).sendKeys("Cricket Pads");
		driver.findElement(By.xpath("//*[@id='collapseOne']/div[1]/div[5]/div[1]/span/span/span")).click();
		humanInteractionWait();
		driver.findElement(By.xpath("//li[text()='Items']")).click();
		humanInteractionWait();
		WebElement wb = driver.findElement(By.xpath("//input[@id='BasePrice']"));
		((JavascriptExecutor) driver).executeScript("arguments[0].removeAttribute('style')", wb);
		wb.sendKeys("300");
		humanInteractionWait();
		humanInteractionWait();
		humanInteractionWait();
		driver.findElement(By.xpath("//div[@id='InventorySettings']/div[1]/h4/a/span/i")).click();
		humanInteractionWait();
		humanInteractionWait();
		humanInteractionWait();
		humanInteractionWait();
		humanInteractionWait();
		humanInteractionWait();
		WebElement wbe = driver.findElement(By.xpath("//*@id='InventoryGrid']/table/tbody/tr/td[2]"));
		humanInteraction.click(wbe).build().perform(); // Exception is coming on this line
		humanInteractionWait();
		humanInteractionWait();
		humanInteractionWait();
		humanInteraction.sendKeys(wbe, "35").build().perform();
		humanInteractionWait();
		humanInteractionWait();
		humanInteractionWait();
		driver.findElement(By.xpath("//button[@id='SaveButton']/span")).click();
	}

	public static void humanInteractionWait() throws Exception {
		Thread.sleep(5000);
	}
}


S
Samir Shandilya Replied on 21/02/2020

Problem still persist in Chrome, code is running in Mozila. But, a pop window comes up "Error Occured" Error not sent by server.


A
Ashish Thakur Replied on 24/02/2020

Please contact developers regarding the slow application.