cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
0 Kudos

Additional Wait() - type command

What inspired this wish list request? 

 

When accessing files from over the internet, it's possible to assess client side issues, such as code 403, which means that the accessing user doesn't have privilages to access the file. The "fix" for this is to open a web window, within JMP and have the user authenticate.  This got me thinking... I could use Wait() and input an arbitrary wait time to allow users to authenticate before the rest of the code completes, a custom function could be used to constantly check at certain time intervals (eg: Wait(1)) to see if a user has authenticated themselves and then check with if loop containing << Has Client Error, OR JMP could impliment a new function Wait Until( <trigger event body here> ) so the execution of additional code doesn't happen until that trigger event is satisfied.

 

What is the improvement you would like to see? 

 

Example

Names default to here(1);

// Proposed - Preferred
auth_test_request = New HTTP Request( URL( some_URL_file_location ), Method( "GET" ) );

test = auth_test_request << Send;

if( auth_test_request << Has Client Error,
	
	// CAN TAKE SECONDS TO FULLY LOAD - Creates new window and loads login page for authentication
	webwindow =  New window( "Login",
	Button Box( "Close when logged ", Wait Until( webwindow << close window ); ),
	wb = Web Browser Box()
	);

	wb << Navigate( authentication_page );
	wb << Set Auto Stretching( 1, 1 );
	wb << Set Max Size( 800, 1000 );
);

// Current - not preferred
auth_test_request = New HTTP Request( URL( some_URL_file_location ), Method( "GET" ) );

test = auth_test_request << Send;

if( auth_test_request << Has Client Error,
	
	// CAN TAKE SECONDS TO FULLY LOAD - Creates new window and loads login page for authentication
	webwindow =  New window( "Login",
	Button Box( "Close when logged ", webwindow << close window; ),
	wb = Web Browser Box()
	);

	wb << Navigate( authentication_page );
	wb << Set Auto Stretching( 1, 1 );
	wb << Set Max Size( 800, 1000 );
);

wait( 10 );

 

Why is this idea important? 

 

Allows further code execution customization

2 Comments
Status changed to: Acknowledged
 
bryan_boone
Staff

Can you provide more information? I think you are using Windows and pre-JMP 17?

If so, then pre-JMP 17's Web Browser Box used Internet Explorer as the web control. Microsoft ended support for IE.

In JMP 17 (and later) JMP uses Microsoft Edge. This means that essentially Edge runs as a different process and JMP has no way of telling who logged in (in your case) and cannot share authentication on the two separate connections.

That being said, I think your application does form-based authentication (correct me if I'm wrong) and you can login with HTTP request using a "PUT" and the form information. If your authentication is using OAuth2 authentication, then that is built into JSL using HTTPRequest and New OAuth2. Examples are in the scripting index.

Feel free to reach out to me with any other information you can provide.