can i program somthing with ranorex like:
if a specific button is visible:
click
else:
....
Does some1 have a code example? Which methode could i use?
check visibility
Re: check visibility
Hello
You could do something like this :
You could do something like this :
if (repo.myitem.Visible){ repo.myitem.Click(); } else { Report.Info("Not visible"); break; }Cheers
A simple thank you always does wonders !
Re: check visibility
my problem at the momoent is, if myitem is not visible, the iteration breaks and i wont get into the else line.
Re: check visibility
That is probably because you are checking for Visible()==true when you should be checking for Exists()==true.
More than likely the element is not there. Check it with spy and make sure that it is actually existing before you check for visible, because if it isn't there Ranorex won't be able to check if it is visible or not.
More than likely the element is not there. Check it with spy and make sure that it is actually existing before you check for visible, because if it isn't there Ranorex won't be able to check if it is visible or not.
Shortcuts usually aren't...
Re: check visibility
ok thats what im looking for....
i just want to know if the button exists
repo.myitem.Exists() == true
does not work for me. What would be the code just for checking if my button exists.
i just want to know if the button exists
repo.myitem.Exists() == true
does not work for me. What would be the code just for checking if my button exists.
Re: check visibility
Hello
If you want to use Exist() you need to do as follows :
if(repo.MyItemInfo.Exists())
{
Report.Info("It exists");
}
else {
Report.Info("It doesn't!");
}
N.B. Ranorex will search for the item until the timeout specified in the repository is reached. So if you want for Ranorex to be faster you can reduce the search timeout according to how long it usually takes to find the item.
Cheers
If you want to use Exist() you need to do as follows :
if(repo.MyItemInfo.Exists())
{
Report.Info("It exists");
}
else {
Report.Info("It doesn't!");
}
N.B. Ranorex will search for the item until the timeout specified in the repository is reached. So if you want for Ranorex to be faster you can reduce the search timeout according to how long it usually takes to find the item.
Cheers
- Attachments
-
- spytimeout.png (10.21 KiB) Viewed 2771 times
A simple thank you always does wonders !
Re: check visibility
thanks.
exactly what i was looking for
exactly what i was looking for
