| View previous topic :: View next topic |
| Author |
Message |
saurabh
Joined: 20 Jul 2007 Posts: 20 Location: India
|
Posted: Wed Aug 29, 2007 12:25 pm Post subject: Problem while doing pageup operation in scroll bar |
|
i am using following code to perform scroll bar opration for page up
Ranorex::Element* buttons[] = Listview->Element->FindChildren(Role::PushButton,"Page up");
for(int k=0;k<buttons->Count;k++)
Mouse::ClickElement(buttons[k]);
But there is a problem. when the scroll bar is already up and we perform "Page up" operation, the mouse arrow goes to the left top corner of screen and click there.So what we were looking if we find out that the scrollbar is already up it should not perform the page up operation any more.
The scroll bar has Role is "Indicator" and name is "Position"
we also tried using the "Indicator" i.e the scroll bar
Ranorex::Element* Ind[] = lvCtrl->Element->FindChildren(Role::Indicator,"Position");
it is receiving all the indicator in the array. but we are again not able to find out if the indicator is already up, and the perform "page up" if required.
I want while i am doing the page up operation and if that Scroll bar has encountered mouse should not click on that means if in mouse click scroll bar(Role:Indicator,Name:Position) has occured it should stop that mouse click operation which i am doing for pageup. I am using RanorexPro1.2 version.
I was also trying with status like
for(int k=0;k<Ind->Count;k++)
if (Ind[k] ->State != Ranorex::State::Invisible)
{do not perform mouse click oprastion}
but its also not working.Please provide me proper code to do that.Its very argent _________________ Regards,
Saurabh Shrivastava
GE Global Research
Bangalore India |
|
| Back to top |
|
 |
admin Site Admin
Joined: 05 Jul 2006 Posts: 351
|
Posted: Thu Aug 30, 2007 1:36 am Post subject: |
|
| Quote: |
| but we are again not able to find out if the indicator is already up |
You can read the value of the Scrollbar as a string with the property Value:
Code: click into code to enlarge
String value = scrollBar.Value;
Jenö
Ranorex Team |
|
| Back to top |
|
 |
chall
Joined: 20 Aug 2007 Posts: 15
|
Posted: Tue Sep 04, 2007 7:38 pm Post subject: |
|
This is what I do; it may work you:
Ranorex.Control control = form.FindControlId(scrollID);
if (control != null)
{
for (int i=1; i<=scrollCount; i++)
{
Element scrollElement = control.Element.FindChild(Role.PushButton, "Page up");
if (scrollElement != null && (!scrollElement.State.Equals(State.Invisible)))
{
Console.WriteLine("Time to start scrolling");
Mouse.ClickElement(scrollElement);
}
else
{
Console.WriteLine("Time to stop scrolling");
break;
}
}
} |
|
| Back to top |
|
 |
|