Hidden Dropdown Box

Ask general questions here.
skhanpara
Posts: 101
Joined: Wed Apr 23, 2014 3:55 pm

Hidden Dropdown Box

Post by skhanpara » Wed Apr 30, 2014 3:43 pm

i am using code module to test a form which has two drop down box

Country and Province

Province will be displayed if i Select Canada as the country

i used this code

var destinationState = repo.NordicInsuranceSoftware.CalculationShell.DestinationState;
if(destinationState.Visible == true)

I am getting error in the first line itself sk13

Please Advise
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: Hidden Dropdown Box

Post by Support Team » Fri May 02, 2014 12:55 pm

Hi,

May I ask you which RxPath is used by the "repo.NordicInsuranceSoftware.CalculationShell.DestinationState" repo item?
Could you please also send me the exact error message?

In order to select an option of the select tag you could use the following code:
SelectTag selectTag = "/dom[@domain='qa.caatravelinsurance.ca']//div[#'calculation-shell']//div[@innertext='Destination country']/..//select[@class='destination-country']";
selectTag.TagValue = "US";
Does this work for you?

Regards,
Markus

skhanpara
Posts: 101
Joined: Wed Apr 23, 2014 3:55 pm

Re: Hidden Dropdown Box

Post by skhanpara » Fri May 02, 2014 9:24 pm

I was able to using try catch

but is there any code to reduce search time

Thank you for your reply

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

Re: Hidden Dropdown Box

Post by Support Team » Tue May 06, 2014 9:53 am

Hi,

Yes, it is possible to reduce the search timeout. When you use the Ranorex Repository you can easily change the search timeout of the repository items by changing the Search Timeout property.
But it is highly recommended to use a not too small search timeout and it is also not recommended to change the Repository Defaults search timeouts.

Regards,
Markus

skhanpara
Posts: 101
Joined: Wed Apr 23, 2014 3:55 pm

Re: Hidden Dropdown Box

Post by skhanpara » Tue May 06, 2014 2:05 pm

Thanks for your reply

i know we can change the search time from the properties tab

but my question was can we change search time for a particular activity
like i want to reduce search time for just one try-Catch block

Thanks

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

Re: Hidden Dropdown Box

Post by Support Team » Thu May 08, 2014 2:09 pm

Hi,

I suppose you perform an action on a specific repository item in the try catch block. If so, you can temporarily change the SearchTimeout of the repo item info object in code.
var destinationStateInfo = repo.NordicInsuranceSoftware.CalculationShell.DestinationStateInfo;
Duration oldSearchTimeout = destinationStateInfo.SearchTimeout;
destinationStateInfo.SearchTimeout = new Duration(25000);// add the new value to the constructor
//... your actions
        	
destinationStateInfo.SearchTimeout = oldSearchTimeout; // set it back to the previous value
Regards,
Markus