Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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.
 
The only cure for that is hours of television radiation. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!