Ask a Question

UserForms - click to run

SOLVED
Lee_M
Community Hero

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

 

5 REPLIES 5
mattb
Staff

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 Hero

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
Champion Level 3

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 Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================

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

AlexKaras
Champion Level 3

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 Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: