public ITestObject GetParentItem()
        {
            ITestObjectLocator parentObjectLocator = Resolver.Resolve <ITestObjectLocator>(Locator.XPath,
                                                                                           GetParentElementXPath(GetAutomationElement()));

            ITestObjectFactory toFactory = Resolver.Resolve <ITestObjectFactory>(browser);

            return(toFactory.Get(parentObjectLocator));
        }
        public ITestObject GetInputChildObject()
        {
            ITestObjectLocator inputObjectLocator = Resolver.Resolve <ITestObjectLocator>(Locator.TagName, "input");

            ITestObjectLocator inputChildTestObjectLocator = Resolver.Resolve <ITestObjectLocator>(Locator.XPath,
                                                                                                   GetXPathTo(GetChildAutomationElementMatchingWith(inputObjectLocator)));

            ITestObjectFactory toFactory = Resolver.Resolve <ITestObjectFactory>(browser);

            return(toFactory.Get(inputChildTestObjectLocator));
        }
        public ITestObject GetChildTestObject(ITestObject to)
        {
            if (GetChildAutomationElementMatchingWith(to.TestObjectLocator) != null)
            {
                ITestObjectLocator childObjectLocator = Resolver.Resolve <ITestObjectLocator>(Locator.XPath,
                                                                                              GetXPathTo(GetChildAutomationElementMatchingWith(to.TestObjectLocator)));
                ITestObjectFactory toFactory = Resolver.Resolve <ITestObjectFactory>(browser);
                return(toFactory.Get(childObjectLocator));
            }

            return(null);
        }
        public ITestObject GetChildItem(int itemNumber, string tagName)
        {
            ITestObjectLocator objectLocator = Resolver.Resolve <ITestObjectLocator>(Locator.TagName,
                                                                                     tagName);

            ITestObjectLocator childObjectLocator = Resolver.Resolve <ITestObjectLocator>(Locator.XPath,
                                                                                          GetXPathTo(GetChildAutomationElementsMatchingWith(objectLocator)[itemNumber - 1]));

            ITestObjectFactory toFactory = Resolver.Resolve <ITestObjectFactory>(browser);

            return(toFactory.Get(childObjectLocator));
        }
        public List <ITestObject> GetAllMatchingTestObjects()
        {
            List <ITestObject> testObjectList = new List <ITestObject>();
            ITestObjectFactory factory        = Resolver.Resolve <ITestObjectFactory>(browser);

            foreach (var element in GetAutomationElements())
            {
                string locatorValue = GetXPathTo(element);
                testObjectList.Add(factory.Get(Locator.XPath, locatorValue));
            }

            return(testObjectList);
        }