Page 1 of 1

how to validate file names

Posted: Mon Sep 28, 2020 3:37 am
by Aaparna16
Hi All,
I am new to Ranorex. I have below requirement-
Few pdf files are placed in below location and i need to extract name of all the files.
location: H:\Test\Project
I am trying to code using C#. But the below code is not working.
Thanks for the help!

IList<Ranorex.Text> childLstItems = GlobalVariable.repo.RNDIDDTEST.ItemsView.FindChildren<Ranorex.Text>();
for(int i=0; i<=childLstItems.Count-1; i++)
{
if((childLstItems).TextValue == "testfile") //this is a pdf file name that i am trying to validate
{
Report.Success("Successfully login");
}
}

Re: how to validate file names

Posted: Tue Sep 29, 2020 7:16 am
by odklizec
Hi,

I assume you are trying to get the list of files from an UI element? In this case, please post a Ranorex snapshot (NOT screenshot) of the element in question. Without, at very least, snapshot, it's very hard to suggest something reliable. Thanks.