public virtual ITestObjectMap GetObjectMap() { if (_objMap == null) { ITestObjectPool pool = GetObjectPool(); pool.SetTestPage(this); _objMap = new TestObjectMap(pool); } return(_objMap); }
/* void LoadPlugin() * Get the dll we need. * use reflecting to load dll at runtime. */ private void LoadPlugin() { _objPool = TestFactory.CreateTestObjectPool(); if (TestFactory.AppType == TestAppType.Desktop) { _testApp = TestFactory.CreateTestApp(); _objPool.SetTestWindow(_testApp.CurrentWindow); } else if (TestFactory.AppType == TestAppType.Web) { _testBrowser = TestFactory.CreateTestBrowser(); _objPool.SetTestPage(_testBrowser.CurrentPage); } else { throw new CannotInitCoreEngineException("Unknow application type."); } }
/* ITestObjectPool CreateTestObjectPool() * return the interface of ITestObjectPool. * This interface is used to find the test object. */ public static ITestObjectPool CreateTestObjectPool() { if (String.IsNullOrEmpty(_testObjPoolDLL)) { throw new CannotLoadDllException("Test object dll can not be null."); } try { _objPool = (ITestObjectPool)LoadDll(_testObjPoolDLL, _testObjectPoolClassName); } catch (Exception ex) { throw new CannotLoadDllException("Can not create instance of test object pool: " + ex.ToString()); } if (_objPool == null) { throw new CannotLoadDllException("Can not create instance of test object pool."); } else { return(_objPool); } }
/* ITestObjectPool CreateTestObjectPool() * return the interface of ITestObjectPool. * This interface is used to find the test object. */ public static ITestObjectPool CreateTestObjectPool() { if (String.IsNullOrEmpty(_testObjPoolDLL)) { throw new CannotLoadDllException("Test object dll can not be null."); } try { _objPool = (ITestObjectPool)LoadDll(_testObjPoolDLL, _testObjectPoolClassName); } catch (Exception ex) { throw new CannotLoadDllException("Can not create instance of test object pool: " + ex.ToString()); } if (_objPool == null) { throw new CannotLoadDllException("Can not create instance of test object pool."); } else { return _objPool; } }
public TestObjectMap(ITestObjectPool pool) { this._objPool = pool; }
public virtual void SetTestObjectPool(ITestObjectPool pool) { this._objPool = pool; }