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

.takeScreenshot();没看到要截图的路径保存地址啊 #5

Closed
loneyao opened this issue Mar 24, 2016 · 8 comments
Closed

.takeScreenshot();没看到要截图的路径保存地址啊 #5

loneyao opened this issue Mar 24, 2016 · 8 comments
Labels

Comments

@loneyao
Copy link

loneyao commented Mar 24, 2016

No description provided.

@ziczhu
Copy link
Member

ziczhu commented Mar 24, 2016

@lengyao88 这个取决你用的客户端,takeScreenshot没有参数,并不会返回截图的保存地址,返回的是图片的base64字符串,如果你的客户端支持saveScreenshot类似的函数,通常是saveScreenshot(path) 这样,就返回截图地址了。

@loneyao
Copy link
Author

loneyao commented Mar 24, 2016

好的,我先试下。

@tsj1107
Copy link

tsj1107 commented Mar 24, 2016

如果是PC端测试 可使用 wd-next API参见https://github.com/macacajs/wd-next/tree/master/docs

移动端测试 可使用 wd API参见https://github.com/admc/wd/blob/master/doc/api.md

@loneyao
Copy link
Author

loneyao commented Mar 24, 2016

我想实现一个滑动的话,看https://github.com/admc/wd
这个文档可以吗?

@tsj1107
Copy link

tsj1107 commented Mar 24, 2016

可以

@loneyao
Copy link
Author

loneyao commented Mar 24, 2016

GET /session/:sessionId/screenshot
Take a screenshot of the current page.

takeScreenshot(cb) -> cb(err, screenshot)

takeScreenshot()我设置为takeScreenshot(path)但是直接报错啊。

@loneyao
Copy link
Author

loneyao commented Mar 24, 2016

.takeScreenshot(path); 我是这样写的,我看到上面是有定义这个path的,但是这个应用应该是支持截图的把。

@ziczhu
Copy link
Member

ziczhu commented Mar 24, 2016

@lengyao88 你看你用的库 如果是wd,是有两个方法的,takeScreenshot() 返回 Base64,saveScreenshot(path) 才是保存到path地址。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants