<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: User Lib question (Thread)</title><description> I have created a user library where I added the StartDynamics() function:   /** Base Functions **/
function StartDynamics() {
	var dynamicsPath = "C:\\Program Files (x86)\\Microsoft Dynamics AX\\60\\Client\\Bin\\";
	var dynamicsFullPath = dynamicsPath + "Ax32.exe";
	var dynamicsQA = " \\\\DAX-RDS-101-WD\\AX_config\\QA_CUS.axc";
	var windows = g_util.FindWindows("regex:.Microsoft Dynamics AX.*", "AxMainFrame");
	if (!File.Exists(dynamicsFullPath)) {
		Tester.FailTest("Dynamics AX Client is not installed on this computer");
		return;
	}
	if (windows.length == 0) {
		Global.DoLaunch(dynamicsFullPath, dynamicsPath, false);
		Global.DoSleep(10000);
		if (SeSFindObj('QA')) {
			SeS('OK1').DoClick();
			Tester.Message('QA');
		}
		if (SeSFindObj('Communication_error')) {
			SeS('OK2').DoClick();
			Tester.Message('Communication error');
			Global.DoLaunch(dynamicsFullPath + dynamicsQA);
			Global.DoSleep(15000);
			if (SeSFindObj('Communication_error')) {
				SeS('OK2').DoClick();
				Tester.FailTest('Communication error');
			}
		}
		Global.DoWaitFor('Home', 60000, 5000);
	}
	maximize('UIAutomation');
	SeS('TabControl').DoSelectTab("Home");
}   I call the function in the TestInit() function in all the tests:   function TestInit()
{
	StartDynamics();
}   LibBase.jslib file:   SeSRegisterLibrary(
	{
		name: 'Base',
		description: 'Base - Default user-defined library',
		include: 'Lib/LibBase/LibBase.js',
		info: null,
		load_order: 1000,
		recording: false, // Only use in playback. If it has recording rules then set it to 'true'
		autoload: true // Always load this library for this test and each subtest
	}
);      The problem is that the tests occasionally fail on the line in TestInit() where I call the StartDynamics() function from the LibBase.js library with:  TypeError(-2146823281): Handle is null or not an object  and only if the Dynamics is not started.  Now, my questions are:  1. Is TestInit() or TestPrepare() better for this kind of function?  2. Should I edit some parameters in the LibBase.jslib file so it reads the LibBase.js immediately on running (if that is the problem here) </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/rapise/issues-questions/1937.aspx</link><item><guid isPermaLink="false">threadId=1937</guid><author>Dimitar Hristovski (Dimitar.Hristovski@interworks.com.mk)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">lib</category><category domain="http://www.inflectra.com/kronodesk/thread/tag">user lib</category><title>User Lib question</title><description> I have created a user library where I added the StartDynamics() function:   /** Base Functions **/
function StartDynamics() {
	var dynamicsPath = "C:\\Program Files (x86)\\Microsoft Dynamics AX\\60\\Client\\Bin\\";
	var dynamicsFullPath = dynamicsPath + "Ax32.exe";
	var dynamicsQA = " \\\\DAX-RDS-101-WD\\AX_config\\QA_CUS.axc";
	var windows = g_util.FindWindows("regex:.Microsoft Dynamics AX.*", "AxMainFrame");
	if (!File.Exists(dynamicsFullPath)) {
		Tester.FailTest("Dynamics AX Client is not installed on this computer");
		return;
	}
	if (windows.length == 0) {
		Global.DoLaunch(dynamicsFullPath, dynamicsPath, false);
		Global.DoSleep(10000);
		if (SeSFindObj('QA')) {
			SeS('OK1').DoClick();
			Tester.Message('QA');
		}
		if (SeSFindObj('Communication_error')) {
			SeS('OK2').DoClick();
			Tester.Message('Communication error');
			Global.DoLaunch(dynamicsFullPath + dynamicsQA);
			Global.DoSleep(15000);
			if (SeSFindObj('Communication_error')) {
				SeS('OK2').DoClick();
				Tester.FailTest('Communication error');
			}
		}
		Global.DoWaitFor('Home', 60000, 5000);
	}
	maximize('UIAutomation');
	SeS('TabControl').DoSelectTab("Home");
}   I call the function in the TestInit() function in all the tests:   function TestInit()
{
	StartDynamics();
}   LibBase.jslib file:   SeSRegisterLibrary(
	{
		name: 'Base',
		description: 'Base - Default user-defined library',
		include: 'Lib/LibBase/LibBase.js',
		info: null,
		load_order: 1000,
		recording: false, // Only use in playback. If it has recording rules then set it to 'true'
		autoload: true // Always load this library for this test and each subtest
	}
);      The problem is that the tests occasionally fail on the line in TestInit() where I call the StartDynamics() function from the LibBase.js library with:  TypeError(-2146823281): Handle is null or not an object  and only if the Dynamics is not started.  Now, my questions are:  1. Is TestInit() or TestPrepare() better for this kind of function?  2. Should I edit some parameters in the LibBase.jslib file so it reads the LibBase.js immediately on running (if that is the problem here) </description><pubDate>Wed, 07 Nov 2018 15:35:40 -0500</pubDate><a10:updated>2018-11-09T10:41:53-05:00</a10:updated><link>/Support/Forum/rapise/issues-questions/1937.aspx</link></item><item><guid isPermaLink="false">messageId=3439</guid><author>Max K (denis.markovtsev@inflectra.com)</author><title> Hi Dimitar,  I think that TestInit is a good place to call StartDynamics. I suggest to run the test</title><description> Hi Dimitar,  I think that TestInit is a good place to call StartDynamics. I suggest to run the test with Internal Debugger and step into StartDynamics function to find out where it fails (I believe it is successfully executed from TestInit).  I also suspect that the failure is in maximize function you call in the end of StartDynamics.  Regards,  Denis </description><pubDate>Fri, 09 Nov 2018 08:04:38 -0500</pubDate><a10:updated>2018-11-09T08:04:38-05:00</a10:updated><link>/Support/Forum/rapise/issues-questions/1937.aspx#reply3439</link></item><item><guid isPermaLink="false">messageId=3440</guid><author>Dimitar Hristovski (Dimitar.Hristovski@interworks.com.mk)</author><title> maximize is a very simple function.   function maximize(window) {
    SeS(window).getDesktopWindow(</title><description> maximize is a very simple function.   function maximize(window) {
    SeS(window).getDesktopWindow().Maximized = true;
}   Ill try it with Internal Debugger and post the results </description><pubDate>Fri, 09 Nov 2018 09:57:11 -0500</pubDate><a10:updated>2018-11-09T09:57:11-05:00</a10:updated><link>/Support/Forum/rapise/issues-questions/1937.aspx#reply3440</link></item><item><guid isPermaLink="false">messageId=3441</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> I would recommend logging as a help desk ticket if you need more help as we dont check the forum po</title><description> I would recommend logging as a help desk ticket if you need more help as we dont check the forum posts as frequently. </description><pubDate>Fri, 09 Nov 2018 10:21:03 -0500</pubDate><a10:updated>2018-11-09T10:21:03-05:00</a10:updated><link>/Support/Forum/rapise/issues-questions/1937.aspx#reply3441</link></item><item><guid isPermaLink="false">messageId=3442</guid><author>Dimitar Hristovski (Dimitar.Hristovski@interworks.com.mk)</author><title> Hi,  This happens rarely, but if this keeps on repeating and we dont find what causes it, I will ra</title><description> Hi,  This happens rarely, but if this keeps on repeating and we dont find what causes it, I will raise a ticket. </description><pubDate>Fri, 09 Nov 2018 10:41:53 -0500</pubDate><a10:updated>2018-11-09T10:41:53-05:00</a10:updated><link>/Support/Forum/rapise/issues-questions/1937.aspx#reply3442</link></item></channel></rss>