Hi, many thanks for the reply, it really is appreciated.I played around with maven profiles, but i dont think it fits with what i want to do.the URL structure is:http://uk + environmentName + something.comso the url is split up into 3 parts. I basically want to set the environmentName from the command line at run time. This will allow the tests to run on dev, qa, prod etc... without having to change anything within the tests.has anyone every done anything like that?
Just a quick question Roberto,So if want to go to dev and extend the url in my test how would i do that?e.g.<profiles><profile><id>dev</id><properties><base.url>http://ukdev.something.com</base.url></properties></profile></profiles>is defined in my pom.xml.Now my test wants to go to http://ukdev.something.com/pageLink/anotherPageLinkfrom my test how do i call in the base.url property. something like this:public WebElement navigateToAnotherPage() {return @driver.goto('${base.url} + /pageLink/anotherPageLink');}
I added this into my pom.xml:<profiles><profile><id>dev</id><properties><base.url>http://uk.dev</base.url></properties></profile></profiles>I tried your solution so i entered this in my test:// The url intended is: http://uk.devENV.something.somthingelse.combut i got the following error:Caused by: java.net.MalformedURLException: no protocol: nullENV.something.somethingelse.com
Ive tried lots of different ways to avoid this error but it doesnt seem tow ork.I ran the test by running: mvn clean verify -P dev from the command line.
would anyone know of any example projects on GitHub or similar that have done somethign similar. turning into a blocker for using Cucumber-JVM with WebDriver for me...
Yes now i understand. Ill make sure I only run from the command line using:mvn clean test -P dev.When i so a System.out.println(xxx + "ENV.something.somethingelse.com"); the full URL is getting printed correctly.The problem is when i do a:driver.get(xxx + "ENV.something.somethingelse.com");it is then returning about:blank as the url.So i need to figure out why the url is being formed in the System.out and not getting formed and exectued in the driver.get() method.