cancel
Showing results for 
Search instead for 
Did you mean: 

Default Parameter

SOLVED
ryanterronez
Occasional Contributor

Default Parameter

I have a default parameter in my keyword test, it is a url called loginPage:

ryanterronez_1-1617639878535.png

When I look at the test case in the Execution Plan that parameter is blank:

ryanterronez_2-1617639945180.png

It feels like the default value of the parameter should be there, any clue why it isn't?

 

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Default Parameter

Hi,

 

Generally speaking, I agree with you and your described scenario but with two notes:

-- Synchronization between keyword test and execution plan must work really well so that every change in the keyword test parameters is reflected in the execution plan; and

-- It must be clear in the execution plan that default value for the parameter is used but not manually entered one.

 

And just because of these two notes I think that empty value displayed in the execution plan for empty parameter is better than some displayed value that can make you to be uncertain whether or not the default value is used.

You are welcome to create either Support ticket via the https://support.smartbear.com/testcomplete/message/ form or create a new Feature Request here and reference this thread: https://community.smartbear.com/t5/forums/postpage/board-id/TestXCompleteFeatureRequests

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

5 REPLIES 5
AlexKaras
Community Hero

Re: Default Parameter

Hi,

 

[Edited]:

It feels like the default value of the parameter should be there

I don't think so.

In the Execution Plan you are specifying that the last parameter is not passed.

And in the test you specify that some value must be used as parameter's value if it is absent or null.

So parameter's actual value during runtime must be equal to the default one. But I don't think that default value must be indicated during design time. (I just see quite a few of potential problems with this and thus I think that current implementation is more relevant.)

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
ryanterronez
Occasional Contributor

Re: Default Parameter

@AlexKaras no, I would never pass an empty string as that parameter.  Do I need to mark that parameter not optional?  I only marked it as optional so that I would stop getting a popup every time I ran the test.

AlexKaras
Community Hero

Re: Default Parameter

@ryanterronez : I just edited my reply as my initial understanding of your question was wrong.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
ryanterronez
Occasional Contributor

Re: Default Parameter

@AlexKaras I added a keyword test to the execution plan six times, each run with different values for the parameters.  After running the tests a few dozen times realized I wanted to add another parameter.  So I added the new parameter to the keyword test, with a default value, and the parameter for the test items on the execution plan are blank.  But if I add that keyword test as a new child test item to the execution plan the parameter has the default value.  In my mind I thought that since the default parameter value is tied to that keyword test, then it should update in the execution plan automatically, just like if I were to update the value of a test variable, or keyword test step.  I don't understand why we wouldn't want that to be updated automatically.  If I call a function from a keyword test, then add a default parameter to that function, I don't need to update the keyword test to run that function.  It seems like the exact same scenario, but they behave differently.

AlexKaras
Community Hero

Re: Default Parameter

Hi,

 

Generally speaking, I agree with you and your described scenario but with two notes:

-- Synchronization between keyword test and execution plan must work really well so that every change in the keyword test parameters is reflected in the execution plan; and

-- It must be clear in the execution plan that default value for the parameter is used but not manually entered one.

 

And just because of these two notes I think that empty value displayed in the execution plan for empty parameter is better than some displayed value that can make you to be uncertain whether or not the default value is used.

You are welcome to create either Support ticket via the https://support.smartbear.com/testcomplete/message/ form or create a new Feature Request here and reference this thread: https://community.smartbear.com/t5/forums/postpage/board-id/TestXCompleteFeatureRequests

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors