Ask a Question

UserForms - click to run

SOLVED
Lee_M
Community Leader

UserForms - click to run

I am creating a Userform that has a button to run a test

I can use the OnClick event to call a script test but NOT A KEYWORD test

 

any idea how to do this, without creating a keyword test call from a test

 

1 ACCEPTED SOLUTION

Accepted Solutions
Lee_M
Community Leader

Re: UserForms - click to run

when I click on the EH section of the component I get these options

 

Lee_M_1-1628146676807.png

 

They can only call scripts

 

Lee_M_0-1628146585436.png

 

 

SmartBear has confirmed to me yesterday that you can only call scripts, although you can create a script that calls the KW test these can not be called directly

 

SB has suggested that, since the UserForms are not the most frequently used tool this functionality is not lightly to change

- it is a limitation that can easily be worked around and good to know this is the only option available here for now

View solution in original post

5 REPLIES 5
mattb
Staff

Re: UserForms - click to run

Hello,

I am confused at what the end goal is here? Are we trying to trigger a script via keyword test, or trigger a keyword test in script?

You could drag and drop your script into the keyword test.

Or in any of the available scripting languages call: "Keywordtests.(Test Name).run()"

I hope this helps!

Lee_M
Community Leader

Re: UserForms - click to run

I am trying to trigger a KW test from a button press

 

I can call a script function in the event handler but I was trying to find if there was a more direct way

AlexKaras
Community Hero

Re: UserForms - click to run

Hi,

 

I can use the OnClick event to call a script test but NOT A KEYWORD test

Can you provide your code for OnClick event?

My expectation is that it must be possible to use KeywordTests object as suggested by @mattb.

 

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
================================
Lee_M
Community Leader

Re: UserForms - click to run

when I click on the EH section of the component I get these options

 

Lee_M_1-1628146676807.png

 

They can only call scripts

 

Lee_M_0-1628146585436.png

 

 

SmartBear has confirmed to me yesterday that you can only call scripts, although you can create a script that calls the KW test these can not be called directly

 

SB has suggested that, since the UserForms are not the most frequently used tool this functionality is not lightly to change

- it is a limitation that can easily be worked around and good to know this is the only option available here for now

View solution in original post

AlexKaras
Community Hero

Re: UserForms - click to run

Hi,

 

Ah, I see now...

Yes, only script routines can be assigned as event handlers for both User Form events and Project events (like OnUnexpectedWindow).

Thank you for the detailed update and reference to Support's reply.

 

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
================================
cancel
Showing results for 
Search instead for 
Did you mean: