Interrogation if Repository was found : General Questions

Interrogation if Repository was found

Ask general questions here.

Interrogation if Repository was found

Postby Todor » Thu Jul 28, 2011 1: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.
Todor
 
Posts: 66
Joined: Mon Jul 25, 2011 12:28 pm

Re: Interrogation if Repository was found

Postby artur_gadomski » Thu Jul 28, 2011 2: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.
User avatar
artur_gadomski
 
Posts: 125
Joined: Mon Jul 19, 2010 7:55 am
Location: Copenhagen, Denmark

Re: Interrogation if Repository was found

Postby Todor » Fri Jul 29, 2011 10: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 12 times
Todor
 
Posts: 66
Joined: Mon Jul 25, 2011 12:28 pm

Re: Interrogation if Repository was found

Postby Todor » Fri Jul 29, 2011 11: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...
Todor
 
Posts: 66
Joined: Mon Jul 25, 2011 12:28 pm

Re: Interrogation if Repository was found

Postby Support Team » Fri Jul 29, 2011 3: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Interrogation if Repository was found

Postby Todor » Mon Aug 01, 2011 9: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
Todor
 
Posts: 66
Joined: Mon Jul 25, 2011 12:28 pm


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests