Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

test failure NoSuchElementException

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm running an Integeration test using selenium and after adding a script tag in my JSP(<script type="text/javascript"
   src="${ctx}/dwr3/interface/CarUpdate.js"></script>
), I started noticing NoSuchElementException.  I have other script tags like above as well , that exists probably from the time when that test was generated. Any idea why this is happening? I'm new to Selenium. How to troubleshoot? Here is the error:




 
Sheriff
Posts: 17652
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would start with lines 9 and 11, see what you can get from the information provided in those lines
 
Jack Tauson
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:I would start with lines 9 and 11, see what you can get from the information provided in those lines



Any idea how I search for the CSS selector after inspecting that page in a browser? Or is there a better way to do it?
 
Junilu Lacar
Sheriff
Posts: 17652
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you know what a CSS selector is?
 
Jack Tauson
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:Do you know what a CSS selector is?



Yes, but how can I search for that particular thing where it's throwing that error:



I have two branches of code where this test works but when I switch to another branch, this test fails. So I want to search for the above and then make comparison where it is failing. Hence looking for a way to search that selector in Firefox developer tools, maybe in the inspect page.

Perhaps I should rephrase and say I am looking to find that particular element on the user interface
 
Sheriff
Posts: 22791
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You say this started when you added a new script element. Are those indexes still correct? Or does the new script cause additional elements to be added that change the indexes of the element you're looking for?
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic