ealiaj
August 2, 2019, 3:43am
1
Anyone know how to use the projects root path in a global variable right now I have in a global variable, I use the global variable to not hardcode the screenshot directory:
C:\Users\SurfacePro\Katalon Studio\BTS\Object Repository\Screenshots\Baseline
Or do i just have to do it through code?
sang
August 2, 2019, 7:06am
2
You can get the project location and adding to the GlobalVariable
Get the project path
String path = System.getProperty("user.dir");
println (path)
Assign the path to GlobalVariable
GlobalVariable.ProjectPath = path
1 Like
ealiaj
August 2, 2019, 7:41am
3
Yeah I can do that too, but have to add that to each test, it’s fine was just thinking I could call it directly into global variable
Ibus
August 2, 2019, 9:36am
4
you can set the needed global in the test listener
sang
August 2, 2019, 10:00am
5
ealiaj you don’t need to add that to each test by using Test Listener
ealiaj
August 2, 2019, 10:59pm
6
yeah forgot about test listeners thanks