Click fails if performed programmatically
Posted: Mon Apr 25, 2016 12:19 pm
hi,
I have a simple structure html structure
<div>
<a>item1</a>
<a>item2</a>
<a>item3</a>
...
...
...
...
<div>
I would like to dynamically click on each aTag so have used user code
Ranorex.DivTag levelbefore = "/dom[@domain='localhost']//div[#'ctl00_tvNavigationn0Nodes']";
//created an adapter
IList<ATag> items = levelbefore.FindDescendants<ATag>();
//called finddescendants
for(int i=0; i<items.Count; i++)
{
//items.MoveTo();
items.Click();
}
The issue is that when the program is run the first click of item1 is successful, and it goes for a toss and clicks somewhere random.
But the same issue is not observed with Moveto() function.
Please let me know what might have gone wrong.
I have a simple structure html structure
<div>
<a>item1</a>
<a>item2</a>
<a>item3</a>
...
...
...
...
<div>
I would like to dynamically click on each aTag so have used user code
Ranorex.DivTag levelbefore = "/dom[@domain='localhost']//div[#'ctl00_tvNavigationn0Nodes']";
//created an adapter
IList<ATag> items = levelbefore.FindDescendants<ATag>();
//called finddescendants
for(int i=0; i<items.Count; i++)
{
//items.MoveTo();
items.Click();
}
The issue is that when the program is run the first click of item1 is successful, and it goes for a toss and clicks somewhere random.
But the same issue is not observed with Moveto() function.
Please let me know what might have gone wrong.