Can't able to assign different Db source to different module

Ranorex Studio, Spy, Recorder, and Driver.
varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Can't able to assign different Db source to different module

Post by varun » Wed Jul 25, 2012 6:51 am

Hi Team,

I want to execute certain recording modules based on the conditions, i.e. if type = "CityPair" then execute Add_CityPair_Profile.rxrec but if type = "Seasonal" then execute Add_Seasonal_Profile.rxrec. Both recorders have there own Db source(Excel) to get data from (using Data driven approach). [See attached RX.png snapshot]
But problem I am facing is that in Data Source I am not able to define separate Db source for both of recording modules. If I try to do so, it overwrites the other one.

So kindly let me know, how can we different Db. sources for different recording modules ??
Attached the snapshot of User code(UserCode.png), I am using to call different recording modules, kindly let me know if it need any correction!

Thanks,
Varun.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Can't able to assign different Db source to different module

Post by Support Team » Wed Jul 25, 2012 10:05 am

Hi Varun,

You are right. It's not possible to use more than one DataConnector in a testcase.
But what you can do is the following. Pack each of the recordings which should have their own data connector into a single testcase (see screenshot). This should solve your problem.
screenshot.png
Regards,
Larissa
Ranorex Support Team
You do not have the required permissions to view the files attached to this post.

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Can't able to assign different Db source to different module

Post by varun » Wed Jul 25, 2012 12:10 pm

Hi Larissa,

Thanks for your kind Support! It really works by defining Data Connector as per Test Cases.
Now my concern is, on executing Test Scenario I am getting Errors which you can see in attached Snapshot. Please go through it and let me know the solution for this.

Thanks,
Varun.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Can't able to assign different Db source to different module

Post by Support Team » Wed Jul 25, 2012 12:19 pm

Hi,

Yeah, this is an easy one. Think you forgot two semicolons ( ; ).

Regards,
Larissa
Ranorex Support Team

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Can't able to assign different Db source to different module

Post by varun » Fri Jul 27, 2012 6:51 am

Hi Larissa,

Your Guidance helping us a lot, Thanks again! 8)

I have a rough draft for the logic I have applied to execute automation queries which you can get in attached text file. Please look into it and get me resolved from following issue -
After executing record1.rxrec, tool always executes condition for "City Pair" for 'n' number of times(if records are of 'n' count in excel) and then it executes condition for "Seasonal" for it's 'm' count(it's data also retrieved from excel).
Note: I am using separate excel for Profile Type field and it should execute conditions based on values in that file.

What I want is, Tool must execute conditions based on the value in excel(for Profile Type) and after executing each condition successfully, it should start again from record1.rxrec.

WR,
Varun.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Can't able to assign different Db source to different module

Post by Support Team » Fri Jul 27, 2012 1:07 pm

Hi Varun,

I think you will like following code-snipped:
Ranorex.Core.Testing.TestCase MyOptionalTC_Seasonal = (Ranorex.Core.Testing.TestCase) Ranorex.Core.Testing.TestSuite.Current.GetTestCase("TC_AddSeasonalProfile");
Ranorex.Core.Testing.TestCase MyOptionalTC_City = (Ranorex.Core.Testing.TestCase) Ranorex.Core.Testing.TestSuite.Current.GetTestCase("TC_AddCityPairProfile");
    	    
        	if(profile_type=="a")
        	{
        		MyOptionalTC_Seasonal.Checked=false;
        		MyOptionalTC_City.Checked=true;
        		MyOptionalTC_City.Run(null, false);
        	}
        	 else if(profile_type=="b")
        	{
        		MyOptionalTC_Seasonal.Checked=true;
        		MyOptionalTC_City.Checked=false;
        		MyOptionalTC_Seasonal.Run(null,false);
        	}
        	else{
        		Report.Info("Sorry:","wrong type");
        	
        }
Kind Regards,
Larissa
Ranorex Support Team