Page 1 of 1

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

Posted: Wed Jul 25, 2012 6:51 am
by varun
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.

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

Posted: Wed Jul 25, 2012 10:05 am
by Support Team
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

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

Posted: Wed Jul 25, 2012 12:10 pm
by varun
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.

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

Posted: Wed Jul 25, 2012 12:19 pm
by Support Team
Hi,

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

Regards,
Larissa
Ranorex Support Team

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

Posted: Fri Jul 27, 2012 6:51 am
by varun
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.

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

Posted: Fri Jul 27, 2012 1:07 pm
by Support Team
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