Data correlation with condition

Ask general questions here.
bhavna.nawani
Posts: 5
Joined: Fri Apr 19, 2019 8:45 am

Data correlation with condition

Post by bhavna.nawani » Fri Apr 19, 2019 9:02 am

Hi,

I have a query regarding multiple test cases execution using data pool. I am new to Ranorex tool.

I have one data pool however i need to apply condition on data rows. i have mapped data correlation to Test suite and need to select row data based on script.

For e.g. I have 4 test scenarios in 1 test suite and also 4 rows in datapool (excel). Before execution of each scenario I need to validate the row in data pool if its mapped to test scenario? If yes then execute.

Thanks
Bhavna

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

Re: Data correlation with condition

Post by odklizec » Tue Apr 23, 2019 7:40 am

Hi,

I'm not exactly sure what is your goal, but as for setting data range from code and running different data ranges under certain conditions, you can use example code from this post:
looping-module-in-a-test-case-t10499.html#p42114
Hope this helps?
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

bhavna.nawani
Posts: 5
Joined: Fri Apr 19, 2019 8:45 am

Re: Data correlation with condition

Post by bhavna.nawani » Thu Apr 25, 2019 10:47 am

Thank you for the response but my requirement is different as i do not require range.
My scenario is

Under one Test Suite -> multiple test cases and each test case will have multiple modules.
Now there is only one data source and i have to bind it to all test cases.
During execution, code need to check for a test case name (or module name) and select the row in datasource (Excel).

I dont need to iterate or run in loop.

Hope I am clear with the scenario. Please assist in getting resolution for this.

Thanks
Bhavna

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

Re: Data correlation with condition

Post by odklizec » Thu Apr 25, 2019 11:19 am

Hi,

Well, I may still be missing something, but why don't you simply assign each test case, with required data row (or rows), via data source properties? This is completely codeless approach, how to assign data rows to test cases, using the same data connector...
DataRange.png
DataRange.png (12.64 KiB) Viewed 144 times
And if you want to do something more dynamic with the test cases and data rows, you should examine the link I posted before. The code in the post explains, how to set particular rows in given test cases.
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

bhavna.nawani
Posts: 5
Joined: Fri Apr 19, 2019 8:45 am

Re: Data correlation with condition

Post by bhavna.nawani » Thu Apr 25, 2019 1:32 pm

Thank You i have applied conditions ( code less) at the moment to achieve results. Was looking for coded method. I have relook at the previous post.