How to handle an .aspx page that may or may not get called.

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Posts: 34
Joined: Mon Sep 24, 2012 9:45 pm
Location: Kansas City

How to handle an .aspx page that may or may not get called.

Post by kdreiling » Wed May 25, 2022 3:21 pm


I have exhausted all avenues of trying to find a solution with a piece of UserCode that I have written. I have also worked with a developer and also was not able to resolve this issue.

The problem is as stated below:

In the attached screen shot this .aspx page may or may not display upon some click event. The code works for this page when running it. The address is selected and the Select button is clicked. The problem is when this page does not come up because there are not multiple addresses to choose from, and instead the system navigates to the same landing page as when the Select button is clicked. When that happens the system falls into a black hole and results in an unhandled error.
Below is the code that I was trying to use to determine True or False when the address page displays. False pushes this code into an error. Typically when I have created these in the past, when false is encountered, Ranorex falls out of the code and moves on to the next recording.

public void MergedUserCodeMethod(RepoItemInfo atagInfo, RepoItemInfo litagInfo, RepoItemInfo inputtagInfo)
bool IsAddress = repo.ApplicationUnderTest.GetFacilityAddress != null ? true : false; //!repo.ApplicationUnderTest.AuthorizationForAdmissionToCareRequ.Visible;

if (IsAddress)
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.GetFacilityAddress.ChosenDefaultChosenSingle' at Center.", repo.ApplicationUnderTest.GetFacilityAddress.ChosenDefaultChosenSingleInfo, new RecordItemIndex(0));
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.GetFacilityAddress.GetLine1' at Center.", repo.ApplicationUnderTest.GetFacilityAddress.GetLine1Info, new RecordItemIndex(1));
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'ApplicationUnderTest.GetFacilityAddress.SelectAddrBtn' at Center.", repo.ApplicationUnderTest.GetFacilityAddress.SelectAddrBtnInfo, new RecordItemIndex(2));

This Friday (5/27) I begin retirement. If you can find a solution by COB 5/26, I would appreciate very much. Thanking you in advance.
You do not have the required permissions to view the files attached to this post.