Iterate through 2 dynamic lists and compare text values
Posted: Tue Jul 31, 2018 10:52 am
Hello, I am not a developer but I am trying to figure out how to do the following:
I am automating a desktop application, and I have a container with 2 dynamic lists (Base on certain device that I have plugged in to my application, the number of rows in the list might vary). I need to iterate through all the existing rows (rows with values) and compare one specific parameter with the other list's parameter.
In the image, I need to compare that each value inside the red circle matches each value of the green circle, however, the number of rows is dynamic and it can vary.
Why I am trying to do is something like (But I am just trying things that I have read in other posts), but this is not doing anything:
Please see my snapshot.
Please any idea and help for this newbie
Thanks
I am automating a desktop application, and I have a container with 2 dynamic lists (Base on certain device that I have plugged in to my application, the number of rows in the list might vary). I need to iterate through all the existing rows (rows with values) and compare one specific parameter with the other list's parameter.
In the image, I need to compare that each value inside the red circle matches each value of the green circle, however, the number of rows is dynamic and it can vary.
Why I am trying to do is something like (But I am just trying things that I have read in other posts), but this is not doing anything:
IList<Ranorex.Cell>myListDriver = repo.VerifyDriverSetting.ListViewDriver.TextViewDriver.Find<Ranorex.Cell>("/form[@title='Verify Driver Setting']//container[@name='driverDetailsView']//list[@name='listView']"); IList<Ranorex.Cell>myListProfile = repo.VerifyDriverSetting.ListViewProfile.TextViewProfile.Find<Ranorex.Cell>("/form[@title='Verify Driver Setting']//element[@name='splitView']/container[@name='profileDetailsView']/?/?/container[@name='paramsTree']/list[@name='listView']"); foreach(Cell cell in myListProfile) { foreach(Cell celda in myListDriver) { string value1 = repo.VerifyDriverSetting.ListViewProfile.TextViewProfile.Caption; string value2 = repo.VerifyDriverSetting.ListViewDriver.TextViewDriver.Caption; if(value1==value2) { Report.Log(ReportLevel.Info, "Value Parameter profile matches the driver parameter"); } else { Report.Log(ReportLevel.Info, "Value Parameter profile does not match the driver parameter"); } }
Please see my snapshot.
Please any idea and help for this newbie
Thanks