Questions tagged [nosuchelementexception]

Use this tag if your problem is caused by or primarily involves a NoSuchElementException in Java.

The NoSuchElementException is a RuntimeException thrown by the nextElement method of an Enumeration to indicate that there are no more elements in the enumeration.

It is also thrown by:

  • the various next* methods (nextInt, nextFloat, nextLine,...) of the Scanner class when input is exhausted;
  • the get method of the Java 8 Optional class when a value is not present;
  • the methods firstElement and lastElement in the Vector class when there are no elements;
  • the methods firstKey and lastKey in the TreeMap class when there are no keys;
  • the methods getFirst, getLast, removeFirst and removeLast in LinkedList when there are no elements;

and other collections.

573 questions
1
vote
1 answer

Py + SeleniumWebdriver - NoSuchElementException not working

I can't understand why isn't this working? I know that there is no such element on this page, but NoSuchElementException isn't raised! from selenium import webdriver from selenium.common.exceptions import NoSuchElementException driver =…
1
vote
0 answers

NoSuchElementException - Python + Selenium List loop

Im new in Selenium and im having trouble trying to make a scrape with a "loop for" and using a search bar in a website to run the itens in the list. Turned the Dataframe in to a list and used the webdriver to access the site lista_Ean =…
1
vote
1 answer

How to click on the 2nd layer of element with mouse in selenium webdriver Python?

I have a code which supposes to 'Mouse Over' the first layer of the element and then click on the second layer of the element which appears when you do 'Mouse Over' action. If I execute the code below it always shows me an error…
1
vote
1 answer

How to use try-expect to skip the case that selenium is unable to locate element using Selenium and Python

My question is how to use try-expect to skip the case that selenium is unable to locate element. For some reasons, I have to skip the situation described above.I want to use try-expect, but I don’t know what to write after except. I use Python…
1
vote
2 answers

How do I use reflection to access a private method?

I'm trying to access private method within reverse() in Java. I've tried my best to make it possible, but failed at last. Can anyone help me to solve this? I just need a success run. Maybe I can change the code. Maybe I'm doing this the wrong…
1
vote
2 answers

Selenium/Java No Such Element Exception for elements of a page after following a link from homepage

New to automation and could use some help here. I am using Selenium Webdriver and Java on this website - Webdriver University and so far this code has been throwing No Such Element exception at "element.click()" step (i.e., doesn't find the element…
katarinen
  • 28
  • 3
1
vote
0 answers

Selenium NoSuchElementException: how to get around this exception for the provided case?

I am using Selenium in the following code to automatically generate different gRNA elements(sequence of strings) using different input data. I show one example below with defined input values for the different drop down menus and input boxes. Once I…
1
vote
1 answer

Can't find element with selenium? (Tried implicit and explicit waits)

I am new to programming and extremely new to web scraping. I need to scrape a table from a web page, where the table is displayed after a video. As I said on the title, I tried implicit waits like: driver.implicitly_wait(40) ... inputElement =…
1
vote
2 answers

Selenium GDPR NoSuchElementException

I want to scrape some data from "https://www.techadvisor.co.uk/review/wearable-tech/". I figured out that looping through the pages with Beautifulsoup does not work. This is the reason why I tried to open it with selenium. The "Accept All" Button to…
Abtc
  • 77
  • 1
  • 4
1
vote
2 answers

Problems logging in to site with Selenium

I'm trying to learn how to use Selenium to log into a site:Ingram-Micro. I made a script and it worked on a different page: https://news.ycombinator.com/login. Now I'm trying to apply the same thing to Ingram-Micro and I'm stuck and I don't know…
1
vote
1 answer

Can't understand how to solve noSuchElementException?

I'm trying to write a program to read a file called scores.txt where it prints out the ID of the student with the highest average across their courses along with their student ID. This is what scores.txt looks like: 34 c081 c082 c083 c084 S2023 …
1
vote
1 answer

Selenium Fluent Wait Implementation in the code still gives "org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element:"

The mentioned URL in the code takes 5 seconds to display the login screen and in order to enter the details on the login page, I have implemented fluent wait for 10 seconds in my code. Even though the wait is correctly mentioned, for some reason…
Bimlesh
  • 269
  • 2
  • 9
  • 20
1
vote
2 answers

What may cause NoSuchElementException?

I spent about two hours searching for the solution but found nothing. As far as I know .nextLine() should wait for input and it usually does. But in this code, it throws java.util.NoSuchElementException: No line found. Can anyone explain what may…
1
vote
1 answer

How to handle exception in findAny().get()

In the below code if queueName is changed to TEST (or any name not in map), then getting the exception java.util.NoSuchElementException: No value present at line .get(); Code is working for values in the map . Requesting for suggestions as to how to…
astar
  • 153
  • 2
  • 3
  • 14
1
vote
2 answers

Unable to locate element: Selenium

I want to select the More Information link by clicking on it. I have tried everything I could but every time the error NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector" pops up. At first, I thought…