Intermittantly fails to find WebElement collection
Posted: Thu Feb 14, 2013 8:44 am
Hi team,
I'm a little puzzled by the following problem:
I have the following line of C# code which is meant to return a collection of webelements, using a "container" element which was acquired earlier:
IList<WebElement> _webElementList = container.Find<WebElement>("." + xpElement, 10000);
This only works intermittently. Sometimes it comes back straight away with the collection filled. Other times it times out returning a empty collection. By inspecting the path using:
string _containerPath = container.GetPath().ToString();
I note that the path is different on the occasions that the collection is not found. However if I execute the subsequent code, it works :
WebElement _container = _containerPath;
_webElementList = _container.Find<WebElement>("." + xpElement, 10000);
If I re-extract the path at this point I note the path has changed.
Can someone please advise what is going on.
Thanks
Mark
I'm a little puzzled by the following problem:
I have the following line of C# code which is meant to return a collection of webelements, using a "container" element which was acquired earlier:
IList<WebElement> _webElementList = container.Find<WebElement>("." + xpElement, 10000);
This only works intermittently. Sometimes it comes back straight away with the collection filled. Other times it times out returning a empty collection. By inspecting the path using:
string _containerPath = container.GetPath().ToString();
I note that the path is different on the occasions that the collection is not found. However if I execute the subsequent code, it works :
WebElement _container = _containerPath;
_webElementList = _container.Find<WebElement>("." + xpElement, 10000);
If I re-extract the path at this point I note the path has changed.
Can someone please advise what is going on.
Thanks
Mark