Need to pass repository object in the variable form

Ask general questions here.
Shakib
Posts: 31
Joined: Tue Jan 06, 2015 7:22 am

Need to pass repository object in the variable form

Post by Shakib » Fri May 12, 2017 3:03 pm

Hi,

Let me start from example:

I have 2 TextBox.
Below the test suite structure for all my test case which i want to perform:

Test Case 1
I want to enter value in first text box.
I want to enter value in Second text box.

TestCase2
I want to enter value in first text box.

TestCase3
I want to enter value in Second text box.

You can assume if will have so many text box and if we need to enter value in all text box.
So in that case we can define one module and write the code where user can call each text box one by one and pass the value.
But suppose i want to enter value in few text boxes in next test case then in this again i need to call required text boxes and pass the value.

For resolving that complexity we can create individual module for each text box and pass the value.
But this can create so many modules that will be hectic for user too much.

So for resolving those complexity Does Ranorex provide a functionality where user can pass repository object as a variable.
And we can create modules there user can use those variable as a parameter value in data source for each test case wherever its require.

Its just like instead of passing xpath in data source, we can pass varaibles where we have stored the controls.So if ny changes comes in future we dont need to worry about the data source parameter value.

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

Re: Need to pass repository object in the variable form

Post by odklizec » Mon May 15, 2017 11:16 am

Hi,

Maybe I misunderstand something, but no, you can't pass a repository element as a "string" variable. All you can do is to create a custom code (method), which accepts elements as a RepoItemInfo or Adapter. But it's not quite the same, because you still have to reference the element in arguments in this form: repo.guiFolder.RepoItemNameInfo

Another thing you might try is the approach discussed here:
convert-string-to-repo-element-t10305.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