question

twile avatar image
twile asked twile posted

Setting local variables in Session Action

How would I execute standard 'eval' actions for the frame a Session's Action was called from within that Session's Action Handler?

 

I've created an iTest plugin with two actions and plan to add more.

 

The standard way to return data from an action would be to use a ResponseBuilder and add Token's to that (TextToken or QueryToken).  That is the current technique I'm using, but it does require any responses to be stored into a variable through iTest Post-Processing.  Which adds another step that I don't need.

 

I'd rather have the Session's Action simply set a variable in it's Frame (locally scoped variable).

iTestsdk
10 |950

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

1 Answer

·
AdamB avatar image
AdamB answered AdamB posted

SDK tools aren't given access to the local heap at this time.  It is a good feature request to allow them to have some sort of sandboxed access.  You might want to talk to the AE/Sales people working with you to help prioritize this.

3 comments
10 |950

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

twile avatar image twile commented ·

What about sending/executing one of the default actions?

 

I'm envisioning sending an 'eval' action with a command string of 'set var val' to ... and that's where I get stuck.

0 Likes 0 ·
AdamB avatar image AdamB twile commented ·

I think that the work around might be to have your tool put the data you want to have in a varialbe in the structured data and then create a global rule for the session profile that does this eval to store it in a variable.  It isn't ideal, but everyone then simply inherits from your base session profile and the values are stored.

 

The Tools don't get to have access to the internals of the kernal to cause it to perform actions, but the above method should work.

 

0 Likes 0 ·
twile avatar image twile AdamB commented ·

I see how that should work, but there are two issues with that.

 

1) There's a bug (feature?) in QueryToken where certain characters are escaped which means any data you send containing backslashes, new lines, some Unicode characters, etc.. get another backslash applied.  So it's impossible to guarantee that the data you are sending back in the response via a QueryToken is the value you want.  I could see this being desirable in what text to send out the response to be shown to the user, but it doesn't make any sense to me to apply this to the value in the Query.

 

2) How to determine what local variable to save the data to?  It would be nice to pass back in that structured data the name of the variable to save the value to.  But, storing to [query . name] doesn't work in the global analysis rule.

0 Likes 0 ·

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.