How to pass java code a parameter from maven for testing

后端 未结 6 1436
故里飘歌
故里飘歌 2020-11-30 03:17

I need to pass on following values …

exeEvironment (Test environment) , testGroup (Group in testNG)

from Command-Line ->

6条回答
  •  悲哀的现实
    2020-11-30 04:03

    Perfect.

    The simplest way to pass the variable from POM.xml to ABC.java

    POM.xml

    
       myhostname.com
    
    

    And in the ABC.java we can call it from the system properties like this

    System.getProperty("hostName")
    

提交回复
热议问题