Page 1 of 1

Not returning the required element

Posted: Thu Apr 23, 2015 11:50 am
by subodh4u7
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;
        }

Re: Not returning the required element

Posted: Fri Apr 24, 2015 11:52 am
by Support Team
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

Re: Not returning the required element

Posted: Mon May 04, 2015 7:47 am
by subodh4u7
dear Robert,

Attached the .rxrep for your reference. Hope this would help.

Re: Not returning the required element

Posted: Tue May 05, 2015 4:16 pm
by Support Team
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

Re: Not returning the required element

Posted: Thu May 07, 2015 5:19 am
by subodh4u7
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.

Re: Not returning the required element

Posted: Fri May 08, 2015 9:26 am
by Support Team
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