Not returning the required element

Ask general questions here.
User avatar
subodh4u7
Posts: 71
Joined: Tue Jan 06, 2015 8:26 am

Not returning the required element

Post by subodh4u7 » Thu Apr 23, 2015 11:50 am

I have a listbox where list of items displayed and i want to search for one item and then return the item as i have mentioned in the GetPatientListItem method. in this item there is button called exam, if its enabled i want to return this button. But GetPath() as mentioned in bold in below methods not working.

In my CheckExamButtonEnabled method, it always checks the exam button which is listed in the first item in the list box. But i want to check which exam button is enabled in the list of items.

Please help me.

Code: Select all

public ListItem [b]GetPatientListItem[/b](string patientName)
        {
           //RepoOrganizerFolders.OrganizerViewFolder repoPatientList = RepoOrganizer.Instance.OrganizerView;
           
           RepoOrganizer repo = RepoOrganizer.Instance;
           //In the TextPatientListItemName element has variable called patientName and which we are setting at runtime taking from csv file
           repo.patientName = "Frank, Horacio";
                      
            if (repo.OrganizerView.OrganizerListBox.Items.Count <= 0)
            {
                return null;
            }

           //return repo.OrganizerView.OrganizerListBox.FindSingle<ListItem>(@"listitem[@name~'" + patientName + "']");
           //var listItem = repo.OrganizerView.OrganizerListBox;
            
           [b]return repo.OrganizerView.OrganizerListBox.FindSingle<ListItem>(repo.OrganizerView.TextPatientListItemName.GetPath());[/b]
        }
		-------------------------------------------------------
	public Button [b]GetExamButton[/b](string patientName)
        {
        	RepoOrganizerFolders.OrganizerViewFolder repo = RepoOrganizer.Instance.OrganizerView;
        	
            var listItem = GetPatientListItem(patientName);
            [b]return listItem.FindSingle<Button>(repo.ButtonExam.GetPath());[/b]
            //return listItem.FindSingle<Button>(@"button[@automationid='PatientListItemExam']");
        }
		--------------------------------------------------------
	public Button [b]CheckExamButtonEnabled[/b]()
        {
        	RepoOrganizerFolders.OrganizerViewFolder repoPatientList = RepoOrganizer.Instance.OrganizerView;
        	
        	int patientListCnt = repoPatientList.OrganizerListBox.Items.Count;
      
        	for (int cnt=0; cnt<patientListCnt;cnt++ )
        	{
        		
        		//if (repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(@"button[@automationid='PatientListItemExam']").Enabled)
        		[b]if (repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(repoPatientList.ButtonExam.GetPath()).Enabled)[/b]
        		{
        			//return repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(@"button[@automationid='PatientListItemExam']");
        			[b]return repoPatientList.OrganizerListBox.Items[cnt].FindSingle<Button>(repoPatientList.ButtonExam.GetPath());[/b]
             		}
        	}

        	return null;
        }
Regards,
Subodh

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

Re: Not returning the required element

Post by Support Team » Fri Apr 24, 2015 11:52 am

Hello subodh4u7,

In order to analyze your issue in more detail we would need a Ranorex snapshot file of your application under test. Additionally, the repository (*.rxrep) would also be helpful.

Thank you in advance.

Regards,
Robert

User avatar
subodh4u7
Posts: 71
Joined: Tue Jan 06, 2015 8:26 am

Re: Not returning the required element

Post by subodh4u7 » Mon May 04, 2015 7:47 am

dear Robert,

Attached the .rxrep for your reference. Hope this would help.
You do not have the required permissions to view the files attached to this post.
Regards,
Subodh

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

Re: Not returning the required element

Post by Support Team » Tue May 05, 2015 4:16 pm

Hello subodh4u7,

Thank you for uploading your repository. It would be great if you could also share a Ranorex snapshot of your application under test. A detailed instruction on how to create such a snapshot file can be found here: Creating a Ranorex snapshot file

Thanks,
Robert

User avatar
subodh4u7
Posts: 71
Joined: Tue Jan 06, 2015 8:26 am

Re: Not returning the required element

Post by subodh4u7 » Thu May 07, 2015 5:19 am

Hello Robert,
I am afraid that I can not share the snapshot since this is confidential application.

is it ok if i send you the screenshot of the some of the part of my application.
Regards,
Subodh

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

Re: Not returning the required element

Post by Support Team » Fri May 08, 2015 9:26 am

Hello subodh4u7,

I think it might be easier to solve your issue via mail. Please send an email regarding your issue to [email protected]. Please provide as much information as possible.

Thanks,
Robert