How to find an Element/cell on a Area/Region URGENT HELP
Posted: Wed Jul 16, 2014 8:25 pm
hello.
I've been asking a few other questions here and there and nobody seems to help. hopefully someone will help me here.
I got to understand ranorex more and more over these past days.
The problem is I am making a automated test for a desktop application.
There is a point where I get to a window with a scrollingRegion where there are many cells. Each cell with a text value within it.
I would LOVE for someone to help me providing some code of a method or a way I can :
1.Identify the scrollingRegion (done with ranorexSpy/ViewSpy).
2.Identify the specific cell I am looking for by its text contents. (to be done, need help)
3.Once Identified, Select that cell (to be done, need help)
And that is it.
Here is hte part of the code I am working on. Obviously I know it is WRONG. But the logic follows somewhat like this I pressume:
Note:
numeroDeInformePolicial is the cell I am trying to find within the ScrollingRegion in the window.
And scrollingRegion is the ScrollingRegion where these cells are, including the one I want to find.
repo.Contenedor.Siguiente is a reference to a "continue" button, because there is more containers with more cells, the button "repo.Contenedor.Siguiente" helps me to get to the other containers to see if the cell is there. But nonetheless the ScrollingRegion scrollingregion is still the same in all cases.
CODE:
Of course if the continue button "repo.Container.Siguiente" is disabled it means there aren't any more containers with cells along the way. And if "mybool" variable is still false then the cell with the value "NumIP" was not found. And an error is reported, and then we end our reports and I hope with this the test will close.
PLEASE HELP ASAP I NEED THIS RESOLVED BY THE END OF THE WEEK
thanks in advance
I've been asking a few other questions here and there and nobody seems to help. hopefully someone will help me here.
I got to understand ranorex more and more over these past days.
The problem is I am making a automated test for a desktop application.
There is a point where I get to a window with a scrollingRegion where there are many cells. Each cell with a text value within it.
I would LOVE for someone to help me providing some code of a method or a way I can :
1.Identify the scrollingRegion (done with ranorexSpy/ViewSpy).
2.Identify the specific cell I am looking for by its text contents. (to be done, need help)
3.Once Identified, Select that cell (to be done, need help)
And that is it.
Here is hte part of the code I am working on. Obviously I know it is WRONG. But the logic follows somewhat like this I pressume:
Note:
numeroDeInformePolicial is the cell I am trying to find within the ScrollingRegion in the window.
And scrollingRegion is the ScrollingRegion where these cells are, including the one I want to find.
repo.Contenedor.Siguiente is a reference to a "continue" button, because there is more containers with more cells, the button "repo.Contenedor.Siguiente" helps me to get to the other containers to see if the cell is there. But nonetheless the ScrollingRegion scrollingregion is still the same in all cases.
CODE:
Code: Select all
Cell numeroDeInformePolicial = "/form[@controlname='Contenedor']/element[@controlname='LayoutWorkspace']/?/?/element[@controlname='decwsAreaTrabajo']/?/?/element[@controlname='uebPanel2']//element[@controlname='ultraPanel1']//table[@accessiblerole='Table']/row[1]/cell[@accessiblename='" + NumIP + "'\\ de\\ Informe\\ Policia']";
Container scrollingRegion = "/form[@controlname='Contenedor']/element[@controlname='LayoutWorkspace']/?/?/element[@controlname='decwsAreaTrabajo']/?/?/element[@controlname='uebPanel2']//element[@controlname='ultraPanel1']//table[@accessiblerole='Table']/container[@accessiblename='Data Area']/container[@accessiblename='Scrolling Region']";
bool mybool = false;
do{
if(scrollingRegion.FindChildren().Contains(numeroDeInformePolicial.Text = NumIP)){
numeroDeInformePolicial.Select();
mybool = true;
}
else if(repo.Contenedor.Siguiente.Enabled){
repo.Contenedor.Siguiente.Click();
}else if(repo.Contenedor.Siguiente.Enabled == false && mybool == false){
Report.Error("cell not found");
Report.End();
}
}while(mybool == false);
Of course if the continue button "repo.Container.Siguiente" is disabled it means there aren't any more containers with cells along the way. And if "mybool" variable is still false then the cell with the value "NumIP" was not found. And an error is reported, and then we end our reports and I hope with this the test will close.
PLEASE HELP ASAP I NEED THIS RESOLVED BY THE END OF THE WEEK
thanks in advance