question

penn.chen avatar image
penn.chen asked ericnute edited

Calling another QC inside a QC, got $session doesn't exist error

Hi, I'm trying to call another QC A inside a QC B, but during execution I saw '$session doesn't exist error' at the point to run the step calling QC B. The $session is effective in QC B. So my question is: what is the best practice for this kind of situation? It seems that iTest will make the session handle effective automatically into QC, however it doesn't for the scenario QC calling QC. Any idea?
iTestquickcall (qc)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vijaykumar avatar image
vijaykumar answered
If we are calling a quick call within a quick call we need to pass session id as a argument. Steps to achieve this: - Declare the session id as a global variable in main testcase![alt text][1] - Pass that global variable as a argument in the quick call ![alt text][2] [1]: /storage/temp/3938-main_testcase.png [2]: /storage/temp/3940-quick_call.png

main_testcase.png (4.2 KiB)
quick_call.png (6.7 KiB)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sandeepreddynv avatar image
sandeepreddynv answered sandeepreddynv edited
Hi Penn, When calling QC A inside QC B, make sure that we are passing the the session handle of QC B to QC A. As we do this iTest will take the same session handle for both quick calls. In below image I created two QCs 1. Commands and 2. Login. I called Login QC under commands and passed the commands session handle arguement to Login such that iTest will use the same ID for both. ![alt text][1] Then called commands QC in main test case and passed main session handle to commands QC. ![alt text][2] [1]: /storage/temp/3941-quick_call.jpg [2]: /storage/temp/3942-main_tc.jpg Hope this resolves your query !! Regards, Venkat

quick_call.jpg (76.4 KiB)
main_tc.jpg (44.4 KiB)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.