Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Can't execute test with Spring Boot and Selenium on random port

 
Ranch Hand
Posts: 30
Android Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I'm writing a very simple test of a web application using Spring Boot and Selenium. Here is the code:



But the test always fails. The two println sentences show that the baseUrl is http://localhost:0 and the title is an empty string.
Is it correct that random port is 0? It sounds me strange, in fact the title is the empty string, but running the app "normally" (not as test) I can see that the title is "Login".
 
Stefano Carniel
Ranch Hand
Posts: 30
Android Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For all people having the same issue, the problem is in the declaration of the port variable. Static field are not supported, removing the qualifier solved the problem.
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic