In tests with Serenity I'm starting my Spring Boot application with a random port.
At some point I need to use a PageObject like this:
@DefaultUrl("http://localhost:8080")
public class GreetPage extends PageObject {
}
The question is: how can I inject a random port number in the PageObject?
I want to somehow replace the 8080 (which is the default port) with the random port provided by Spring Boot test.
You could set the proper URL in the constructor of your Page Object using setDefaultBaseUrl()
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments