app.screenshot() dont capture screenshot even though it display in logs

Hi guys,
Could you please support me on this query.
am trying to run the below command
app.screenshot("title");

I do get the logs as shown below

Took screenshot. { Path: "/Users/jebran/Projects/Demo/Demo/bin/Debug/screenshot-3.png", Title: "When I press add" }

but there is no image in the above path.

kindly find my project package detail.

Nunit 2.6.4
Xamarin.UITest 2.2.7
SpecFlow 1.9.0
SpecFlow.Nunit 1.1.1

Best Answer

  • JamesLaveryJamesLavery GB ✭✭✭✭✭
    Accepted Answer

    Is this on Android? Do you have

    Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);

    in the MainActivity?

    If so, this messes up UITest screenshots. You need to disable the above if you're running a UITest.

Answers

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭
    Accepted Answer

    Is this on Android? Do you have

    Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);

    in the MainActivity?

    If so, this messes up UITest screenshots. You need to disable the above if you're running a UITest.

  • JohnHardmanJohnHardman GBUniversity mod

    @sheikhjebran

    Is this using UITest with a local physical device, or is this running in Test Cloud?

    I haven't used UITest for a while, but when I did, for local testing I used to get the FileInfo returned from App.Screenshot and do a File.Copy immediately (from fi.FullName), to ensure I had all captured screenshots in a known folder that was not user-specific.

  • sheikhjebransheikhjebran Member ✭✭

    @JohnHardman the issue was with the application. not with the code. The screenshot works fine with me now

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    @sheikhjebran said:
    @JohnHardman the issue was with the application. not with the code. The screenshot works fine with me now

    What was the problem and solution? Useful for others to know.

Sign In or Register to comment.