Forum Discussion

vvrajesh's avatar
vvrajesh
Visitor
11 years ago

Is there any simple method to retrieve the root node of any object

I'm a bit stuck with one of the areas on taking screenshots which includes both mobile and desktop/web combination.

 

When i use the following

sys.desktop.picture() - this gets me the local machine screenshot

mobile.device.desktop.picture() - this takes the mobile screenshot

 

I need to differentiate the screenshot based on the object which i'm testing on.

 

This can be done only using the root method or by reverse looping the object parent which is a tedious job.

 

Please let me know if there are any alteratives.

2 Replies

  • scsvel's avatar
    scsvel
    Frequent Contributor

    I would simply use a project variable to store the type and use it; and the value keep on reset whenever I am calling the screenshot function by adding the value assignment along with screenshot function.


  • vvrajesh wrote:

    When i use the following

    sys.desktop.picture() - this gets me the local machine screenshot


    Assuming you are running an embedded/emulator for the mobile devices, why not use Sys.Desktop.ActiveWindow(), thus the image context would be determined by the test that was execuring when the screenshot was taken?