Questions tagged [invalidselectorexception]

InvalidSelectorException : org.openqa.selenium.InvalidSelectorException commonly know as InvalidSelectorException extends org.openqa.selenium.NoSuchElementException and is inherited from org.openqa.selenium.WebDriverException. The fields inherited from WebDriverException are BASE_SUPPORT_URL, DRIVER_INFO, SESSION_ID.

InvalidSelectorException

org.openqa.selenium.InvalidSelectorException commonly known as InvalidSelectorException extends org.openqa.selenium.NoSuchElementException and is inherited from org.openqa.selenium.WebDriverException. The fields inherited from WebDriverException are :

  • BASE_SUPPORT_URL : protected static final java.lang.String BASE_SUPPORT_URL
  • DRIVER_INFO : public static final java.lang.String DRIVER_INFO
  • SESSION_ID : public static final java.lang.String SESSION_ID

Reference : Class InvalidSelectorException

15 questions
3
votes
4 answers

OpenQA.Selenium.InvalidSelectorException: 'invalid selector: An invalid or illegal selector was specified error in Selenium

I am using chromedriver in CS to find an element using css selector however I receive the following error: OpenQA.Selenium.InvalidSelectorException: 'invalid selector: An invalid or illegal selector was specified My code: var body =…
user13939246
1
vote
1 answer

InvalidSelector Error: compound class names not permitted using "FindElementByClass"

I am having trouble with code while trying to take the class name. I have tried and run time error 32 is appearing as: InvalidSelector Error: compund class names not permitted Maybe somebody canhelp with the code below. I have chrome browser…
1
vote
1 answer

Why selenium webdriver can't find element

In screen you can see, that entered selector is only one. Here is code, where I have entered the same selector, but getting error like this: Element info: {Using=css selector, value=//*[contains(@class,'v-label v-label--active theme--light…
1
vote
2 answers

getting InvalidSelectorException while locating for an element using the using same xpath that works fine in firepath with 1 matching node

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //a[Contains(Text(),'Forgot Password?')] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document':…
1
vote
2 answers

Appium Unable to locate elements in mobile app using text in UIAutomator

When I try to use text in XPath, I am getting the error org.openqa.selenium.InvalidSelectorException: Argument was an invalid selector (e.g. XPath/CSS). (WARNING: The server did not provide any stacktrace information)" This is the code that i am…
0
votes
3 answers

find List Item based on known string

I'm playing around with booking.com as I teach myself selenium / python. I'm trying to select a currency based on a known string e.g. 'USD'. I'm able to click the currency icon to open the currency selection modal but then when I try to say find…
0
votes
1 answer

Java Selenium - An invalid or illegal selector was specified

I wanted to create an method that I can reuse whenever there is a form/textbox on the page and check if it is existing by returning True/False. I created Fields() that I placed on the same Sele class But I am not sure why I am getting the error…
newb03
  • 1
  • 2
0
votes
2 answers

selenium.common.exceptions.InvalidSelectorException: Message: Given xpath expression is invalid using By.XPATH through Selenium Python

I'm trying to develop an autologin für Instagram and I got the following problem. Here is my code: from time import sleep from selenium import webdriver from selenium.webdriver.common.by import By browser =…
0
votes
2 answers

Selenium Web Scraping (InvalidSelectorException)

I am trying to web scrap a website with navigating the different pages. I tried this code on another website that works for scrapping. I have now trying to scrap another website and failed. It shows that…
0
votes
2 answers

differences between InvalidSelectorException and NoSuchElementException and locating items

I am running a test nightly via Jenkins. About 95% of the time it passes. But occasionally it is failing doing this: driver.findElement(By.xpath("//div[contains(@id, 'stage')]/div[contains(@class, 'tabMenu')]/span[contains(@class, 'menuItem') and…
Tony
  • 1,127
  • 1
  • 18
  • 29
0
votes
1 answer

invalid selector: Unable to locate an element with the xpath expression error with ChromeDriver and Chrome using Selenium

I am currently facing a problem with Selenium and findElements(By.xpath()). Currently I am automating on Salesforce (dynamic IDs and we are using text() so we cannot use CSS selectors) and while my XpathFinder (Chrome AddOn) is able to process the…
0
votes
2 answers

Selenium | NamespaceError: Failed to execute 'evaluate' on 'Document' | Contains unresolvable namespaces

I am able to inspect an element using browser's Developer tools like below: Inspected the element using FireFox: /html/body/div[1]/div/div[8]/form/div[2]/spring:eval/table/tbody/tr[2]/td[5] Inspected the same element using Chrome as…
PraveenKS
  • 1,145
  • 3
  • 13
  • 28
0
votes
3 answers

getText() of an element outside any tag without using text() in xpath

So I need to get a particular text in a webpage that contains 200+ lines of text outside a tag or after span tag. I was able to get the exact xpath, By outputVersion = By.xpath("//*[@class='output']/text()[contains(.,'TEXT THAT I NEED')]"); By…
0
votes
3 answers

InvalidSelectorException while locating submit button through Selenium and Python

I am having not luck getting a button click on a webpage. in python coding using selenium on chrome browser. I have found the xpath in chrome inspect. chrome inspect xpath: NOTE Which is a looks to be a dynamic path after…