A method of establishing a hierarchical relationship between a plurality of User Interface, UI, elements, the method comprising: receiving, by an image processing system, a plurality of input images related to a plurality of UI screens of an application from one or more sources; identifying, by the image processing system, the plurality of UI elements and respective positions of the plurality of UI elements in each of the input images; obtaining, by the image processing system, a label corresponding to each of the plurality of UI elements in each of the input images, wherein obtaining the label comprises: obtaining sub-images of each of the input images by cropping regions of each of the plurality of UI elements; and extracting text from each sub-image; and determining, by the image processing system, a level corresponding to a number for automatically establishing the hierarchical relationship between the plurality of UI elements for each of the plurality of UI elements identified in each of the plurality of UI screens, by sorting, by the image processing system, each of the plurality of UI elements identified in each of the plurality of UI screens based on the respective positions of the plurality of UI elements in each of the plurality of UI screens; identifying an in-common label corresponding to two or more of the plurality of UI elements present in two or more UI screens related to the plurality of input images, wherein the UI elements having an in-common label correspond to UI elements having a same label in different UI screens; associating the plurality of UI elements having a corresponding in-common label together; and assigning, a number to each of the plurality of UI elements based on the sorting and the association, wherein the number indicates the level of each of the plurality of UI elements. receiving, by an image processing system, a plurality of input images related to a plurality of UI screens of an application from one or more sources; identifying, by the image processing system, the plurality of UI elements and respective positions of the plurality of UI elements in each of the input images; obtaining, by the image processing system, a label corresponding to each of the plurality of UI elements in each of the input images, wherein obtaining the label comprises: obtaining sub-images of each of the input images by cropping regions of each of the plurality of UI elements; and extracting text from each sub-image; and determining, by the image processing system, a level corresponding to a number for automatically establishing the hierarchical relationship between the plurality of UI elements for each of the plurality of UI elements identified in each of the plurality of UI screens, by sorting, by the image processing system, each of the plurality of UI elements identified in each of the plurality of UI screens based on the respective positions of the plurality of UI elements in each of the plurality of UI screens; identifying an in-common label corresponding to two or more of the plurality of UI elements present in two or more UI screens related to the plurality of input images, wherein the UI elements having an in-common label correspond to UI elements having a same label in different UI screens; associating the plurality of UI elements having a corresponding in-common label together; and assigning, a number to each of the plurality of UI elements based on the sorting and the association, wherein the number indicates the level of each of the plurality of UI elements. obtaining sub-images of each of the input images by cropping regions of each of the plurality of UI elements; and extracting text from each sub-image; and determining, by the image processing system, a level corresponding to a number for automatically establishing the hierarchical relationship between the plurality of UI elements for each of the plurality of UI elements identified in each of the plurality of UI screens, by sorting, by the image processing system, each of the plurality of UI elements identified in each of the plurality of UI screens based on the respective positions of the plurality of UI elements in each of the plurality of UI screens; identifying an in-common label corresponding to two or more of the plurality of UI elements present in two or more UI screens related to the plurality of input images, wherein the UI elements having an in-common label correspond to UI elements having a same label in different UI screens; associating the plurality of UI elements having a corresponding in-common label together; and assigning, a number to each of the plurality of UI elements based on the sorting and the association, wherein the number indicates the level of each of the plurality of UI elements. sorting, by the image processing system, each of the plurality of UI elements identified in each of the plurality of UI screens based on the respective positions of the plurality of UI elements in each of the plurality of UI screens; identifying an in-common label corresponding to two or more of the plurality of UI elements present in two or more UI screens related to the plurality of input images, wherein the UI elements having an in-common label correspond to UI elements having a same label in different UI screens; associating the plurality of UI elements having a corresponding in-common label together; and assigning, a number to each of the plurality of UI elements based on the sorting and the association, wherein the number indicates the level of each of the plurality of UI elements.