Supplying Values to Multiple Repository Attributes

Class library usage, coding and language questions.
mcs
Posts: 29
Joined: Mon Aug 11, 2014 5:00 pm
Location: Portsmouth, NH

Supplying Values to Multiple Repository Attributes

Post by mcs » Tue Jun 14, 2016 5:18 pm

Hi,

I am attempting to set values in User Code for a repository item which is a calendar date; the attributes that I need to set are title and innertext.

My repository item is named PickDate with an xpath of body/div[5]/div[@title='All Day' and @innertext='22']

I can successfully select the date in my code when the title and innertext values are hardcoded as they are above but, when I set the values to $dayPortion and $day, I can't seem to figure out how to populate both values with my code so that the specified date is selected. I would think that this would be easy to accomplish but I must be missing something.

Thanks for any help, hints, words of encouragement, etc....
Mike

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Supplying Values to Multiple Repository Attributes

Post by odklizec » Wed Jun 15, 2016 8:18 am

Hi,

Please post a Ranorex snapshot (not screenshot) of the problematic element.

At next, I think this post is more or less related to your previous post here...
http://www.ranorex.com/forum/retrieving ... tml#p38407
You should not use non-persistent attributes to identify elements in repository. Or you should replace the hardcoded string with variable, which must be filled with correct string BEFORE you access the element. For example via data connector. Please take a closer look at Data Driven testing chapter in Ranorex user guide...
http://www.ranorex.com/support/user-gui ... sting.html
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

mcs
Posts: 29
Joined: Mon Aug 11, 2014 5:00 pm
Location: Portsmouth, NH

Re: Supplying Values to Multiple Repository Attributes

Post by mcs » Wed Jun 15, 2016 7:19 pm

I was able to figure this out today... really don't know why I had hit a roadblock on it. I am now successfully supplying a title and innertext value in my code to select a specified divtag date in a divtag calendar in a foreach loop inside another foreach discovery loop of the calendar members.

Thanks,
Mike