• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic