Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Saving snapshot of screen / open it in Inspector #178

Open
Lordvolle opened this issue Oct 13, 2021 · 3 comments
Open

Feature request: Saving snapshot of screen / open it in Inspector #178

Lordvolle opened this issue Oct 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@Lordvolle
Copy link

Hello.
What if appium will save Screenshot, Datasource, some data like date, screen size, device model in one archive, and open this archive in Appium Inspector?
It's common situation, that developers change some locator in app and test failed after that. Every time i start test locally to get new locator, but if appium would save snapshot, i save it at the end of failed test, and open it in inspector. It will save time, especially in long scenario

@jlipps
Copy link
Member

jlipps commented Oct 13, 2021

Thanks for this idea. The recommendation for this is to do the saving yourself as part of your testsuite. In pseudo code, let's say you have a teardown function. You could do something like this:

def teardown():
    if driver.sessionId:
        write_file(driver.page_source)
        write_file(driver.screenshot)
        driver.quit()

If you're using a CI server it's probably possible to associate this data directly with the CI run. obviously you'd want to give things names related to the session ID so you can find the data. You can also print out device information if you want. And you could choose to only save this kind of information in the event of a failure and not in every case.

I don't think we will ever implement a way to open up some archive in Appium Inspector. the Inspector really only makes sense in the context of a live session. If what you want is simply a way to view the screenshot and source side by side, then you can simply arrange the windows on your computer in that fashion.

@jlipps jlipps closed this as completed Oct 13, 2021
@Lordvolle
Copy link
Author

@jlipps
Thanks for your answer. I like the way you parse and render data_source in inspector, but it will be difficult to implement your methods from inspector like parseCoordinates and generate XPath... But i thought, that if data_source will be not from session but xml file, it will be just one 'if' in code (at least to build the tree)...

@jlipps
Copy link
Member

jlipps commented Oct 13, 2021

I think it would actually be a more significant change in the inspector since much of the UI would need to be disabled. But let me think more about this. I do see your point about being able to use the selector generation tool. Also, if you wanted to take a stab at a PR, that would make it easy to consider as well.

@jlipps jlipps reopened this Oct 13, 2021
@mykola-mokhnach mykola-mokhnach transferred this issue from appium/appium Oct 13, 2021
@eglitise eglitise added the enhancement New feature or request label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants