Interrogation if Repository was found

Ask general questions here.
Todor
Posts: 66
Joined: Mon Jul 25, 2011 11:28 am

Interrogation if Repository was found

Post by Todor » Thu Jul 28, 2011 12:57 pm

Is it possible to make an if-clause, wether a repository was found or not?
Because I have a repository item in my repository, that can not be found by ranorex, although it has the full path to the item.

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Interrogation if Repository was found

Post by artur_gadomski » Thu Jul 28, 2011 1:00 pm

If you mean an element from a repository:
if (repository.SomeFolder.elementInfo.exists()) {
Report.Debug("Found element");
}
Whare repository is your repository object, folder and element are in a repository. Each element should have an Info object automaticaly created.

Todor
Posts: 66
Joined: Mon Jul 25, 2011 11:28 am

Re: Interrogation if Repository was found

Post by Todor » Fri Jul 29, 2011 9:49 am

The problem is that I have a repository item that can not be clicked by ranorex and i dont know why.
I tried recording the button, then taking the absolute path, I tried tracking the button with the spy with the absolute path, I tried shortening the path but nothing works. I will send you a Ranorex snapshot, maybee you can help me.
Attachments
snap.rxsnp
(919.82 KiB) Downloaded 133 times

Todor
Posts: 66
Joined: Mon Jul 25, 2011 11:28 am

Re: Interrogation if Repository was found

Post by Todor » Fri Jul 29, 2011 10:19 am

Okay this is odd.
I have made a recording which presses the save button. When I play the recording it finds the button but when I play the complete test, the recording doesn`t find the button...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Interrogation if Repository was found

Post by Support Team » Fri Jul 29, 2011 2:41 pm

What's the RanoreXPath of the item you are searching for?
Could you post the complete error message you get when the item is not found?
Do you get any warnings in the report?

From your snapshot it looks like the "ID" attributes of your web elements are dynamic, i.e. they might not be the same every time you start the browser/scenario. Try not to use dynamic attributes or try to use regular expressions to only check for static parts of the ID.

See following sections in the Ranorex User Guide and the RanoreXPath screencasts for more information:
http://www.ranorex.com/support/user-gui ... xpath.html
http://www.ranorex.com/support/user-gui ... ditor.html
http://www.ranorex.com/support/screencasts.html

Regards,
Alex
Ranorex Team
.
Image

Todor
Posts: 66
Joined: Mon Jul 25, 2011 11:28 am

Re: Interrogation if Repository was found

Post by Todor » Mon Aug 01, 2011 8:18 am

The ID of the used Webelements is not dynamic, I have tested that one first. I have edited the path about 100 times until i found a path that would work. The path is :

Code: Select all

".//li[@id='Ribbon.ListForm.Edit.Commit']/span[1]/span[1]/span/span/span/a[@id='Ribbon.ListForm.Edit.Commit.Publish-Large']/span[@innertext='Speichern']"
I still don't know why the others did not work but problem solved ;)

with kind regards