I am getting below error while trying to automate sample Qlikview web report tho

  • 1 Replies
  • 544 Views
I am getting below error while trying to automate sample Qlikview web report though Selenium

Xpath returned by FirePath:

Code
  .//*[@id='58']/div[2]/div/div[1]/div[4]/div[1]

Exception:

Code
  **Exception**: Exception in thread "main"                 
   org.openqa.selenium.InvalidSelectorException: The given   
   selector//[@id='58']/div[2]/div/div[1]/div[4]/div[1] is either invalid         
   or does not result in a WebElement. The following error occurred:     
   InvalidSelectorError: Unable to locate an element with the xpath       
   expression //[@id='58']/div[2]/div/div[1]/div[4]/div[1] because of the     
   following error:**SyntaxError: The expression is not a legal expression.**
   Command duration or timeout: 78 milliseconds
   For documentation on this error, please visit: http://seleniumhq.org       
   /exceptions/invalid_selector_exception.html
    Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'

I tried running by removing '.' from xpath but still the same error is occuring.

Code Sample:

// Navigate to Quarter 4 Results

Code
    driver.findElement(By.xpath("//[@id='58']/div[2]/div/div[1]/div[4]/div[1]")).click();
}
sailaja

Your XPath is indeed wrong, it should have a wildcard before the square bracket as FirePath returns:
Code
.//*
...
Your doesn't:
Code
//[@id='58']
...

 

Sitemap 1 2 3 4 5 6 7 8