EnsureVisible and Click not working
Posted: Wed Sep 19, 2012 4:29 pm
Hi,
My environment :
Ranorex 3.0.5.13548
Windows XP Pro SP 3 French Edition
.NET Framework 3.5 SP 1
I have a modal popup page to edit an article, in this popup page, i have a div that is decorated like a select tag, and inside the div, i have some other div and deep down, i will have a radiobutton and a label to choose.
I use user code in the recording module to loop through the div and find a specific label, and then select the radiobutton, and click it.
My code
The problem is, the label and radiobutton (input) are found, but it seems that it didn't get clicked.
Any ideas what's wrong ? i also already created a snapshot of my page, but i don't know where to send it.
Thanks in advance
My environment :
Ranorex 3.0.5.13548
Windows XP Pro SP 3 French Edition
.NET Framework 3.5 SP 1
I have a modal popup page to edit an article, in this popup page, i have a div that is decorated like a select tag, and inside the div, i have some other div and deep down, i will have a radiobutton and a label to choose.
I use user code in the recording module to loop through the div and find a specific label, and then select the radiobutton, and click it.
My code
Code: Select all
// click button to open the div
repo.AssortimentFO.btn_Contenance.Click();
// ensure visible the div
repo.AssortimentFO.div_Contenance.EnsureVisible();
// move the mouse to the div
Mouse.MoveTo(repo.AssortimentFO.div_Contenance, Location.Center);
// looping through all div,
LabelTag lbl = null;
foreach (DivTag di in repo.AssortimentFO.div_Contenance.Find("div"))
{
if (di.TryFindSingle("label[@innertext='" + repo.ContenanceText + "']", out lbl)){
lbl.Parent.EnsureVisible();
InputTag input = lbl.Parent.FindSingle("input");
if (input != null) {
input.EnsureVisible();
Mouse.MoveTo(input, Location.Center);
input.Click();
}
break;
}
}
The problem is, the label and radiobutton (input) are found, but it seems that it didn't get clicked.
Any ideas what's wrong ? i also already created a snapshot of my page, but i don't know where to send it.
Thanks in advance