Is there any way i can identify the name of the current test case during run time

Hi All,

I have a list of test cases which i am executing through orchestrator, is there any activity or code which gives the information about the test case that is running currently say testcase name

Appreciate your response

1 Like

@raja.raviraj we could add some message box or log message inside test case to show the test case name which is running

1 Like

@raja.raviraj

Use log message activity in you code then you can check the logs from orchestrator each step by step

Thanks
Varun

1 Like

Hi @raja.raviraj

You can use get current job info in your test case then you can get all details about current job(Name,ProcessName,Version etc) which can be logged using a log message activity to display

https://docs.uipath.com/activities/docs/get-current-job-info

cheers

1 Like

Thanks for the reply, UiPath.Core.Activities is no longer available.It is split into uipath.uiautomation and uipath.system.I dont see this activity in my studio(2022 version).I see something called JobState which is the enum.I verified in both windows-legacy and windows.I am using c# as the language

1 Like

Thanks for your reply.i dont want to hard code the test case name in every test case that is the tedious job.

Hi @raja.raviraj

This is part of uipath.system.activities not core.activities. Can you tell what issue you are getting?

Okay let me check in c# project also

cheers

Hi @raja.raviraj

Just now check in C# and I am able to see get current job info . Can you please recheck

cheers

1 Like

yep this works. Thanks much !!!

1 Like

@Anil_G Another question related to the same topic, is there anyway i can get the current testsetexecution id.This is the id which is unique for all the test execution and help us to identity the results of the test execution through swagger api.I am getting this ID through the swagger api, the same i need to get while executing the test cases.Please let me know for any clarification

@raja.raviraj

So are you getting the Execution ID from swagger or you want to use the execution ID and get details from swagger?

You can always use orchestrator http request to use api for orchestrator if that is the question

cheers

yes you are rit.I can use orc http request but how do we know what is the executionid for the current execution.

Example:
https://cloud.uipath.com/sdrauipathcloud/DefaultTenant/orchestrator_/odata/TestCaseExecutions

This gives all the testsetexecids but i need the current execution id, using the same once the execution completes ill get the details using the same swagger api and generate test report

@raja.raviraj

Isn’t that linked to the job ID as well?

Like for every execution there will be a job id so you can filter with job id and then get the corresponding testexecution id of that job

Let me know if I am missing something here?

cheers

Based on your comment i have to follow below steps to get the testsetexecutionid.

step 1 - Using orchestrator http request get the Running job id first
Ex-“/odata/Jobs?$filter=State eq ‘Running’ and HostMachineName eq '” + Environment.MachineName + “'”
Example output - 687676
step 2 - Again Using orchestrator http request get the testexecutionid for the same job id
Ex-odata/TestCaseExecutions?$orderby=(StartTime) desc&$Filter=Jobid eq 687676

is that rit or is there any other way to get the currently running job id.Please clarify

Hi @raja.raviraj

Yes this is how you would get it

cheers

thanks…in some other post i saw this piece of code to get the Job Id
UiPath.Executor.ExecutorManager.Instance.Id.ToString().Looks easier but not working for me. I am using windows + c# combination.Is there any way to get the id using this piece of code.Is there any library i have to download

Please refer below post

@raja.raviraj

Yes I have seen it…but yes there is some issue …that the library is not fully exposed so we are not able to use it directly. so as of now we have the orchestrator api route itself…

It would give some error on executor always

1 Like

thank you, ill go with http orchestrtor api

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.