通过IDEA对testng测试方法进行调试
如果testng的测试方法对配置文件无特殊要求,直接运行debug用系统生成的临时配置即可
如果对配置文件有依赖,如一些公有参数是通过testng.xml(这个文件可以自定义),parma获取的则需要指定parma然后运行debug否则会报参数异常
直接配置debug方法并指定入参
上面name<-->value 对应testng.xml配置文件中的 parameter 参数
通过运行testng.xml配置文件debug来进行调试
可以单独建立一份debugtestng.xml 里面单独指定测试方法,idea中右击这个配置文件用debug模式运行
注意
idea需要关闭instrumeting agent,可以照下面说明在IDEA配置中找到,去除打勾后重启IDEA。不按此操作直接debug会报如下错误
Exception in thread "main" java.lang.ClassCircularityError: java/lang/WeakPairMap$Pair$Weak
..
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:107)
http://rafaelhz.github.io/testing-websockets/
websocket进行junit单测