Wamboo
6 years agoCommunity Hero
Get Unit name in script
Does anyone know the solution to this problem?
How do I get the name of the file you were running the script from?
Having this name as the data to be used in the current script.
Hi
Thank you for your answers.
TanyaYatskovska this code refers to the name of the running function and not to the name of the file in which the function is stored.
I found a solution how to find the name of the file from which the function is run.
function retrievedNameRelatedUnit() { let testItemNameFull = Project.TestItems.Current.ElementToBeRun.Caption; var formatTestItemNameFull = testItemNameFull.split(/\Name-Full.split(/\Name-- /)); return formatTestItemNameFull[1]; }
there is an array with the file name in the variable.
You can use the file name (Unitu) to dynamically run the file by e.g. aqObject Object
TY for all your help!