Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am running Selenium WebDriver test on a remote PC from my laptop(java client), by using RemoteWebDriver. But RemoteWebDriver haven't provided screenshot API to directly get a screenshot of remote PC. Googled a lot but found seems need use to Json API to get it from remoteWebDriver server directly. Anyone can give me some instruction about how to do that? Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
350 views
Welcome To Ask or Share your Answers For Others

1 Answer

The RemoteWebDriver must be augmented before you can use the screenshot capability. As you have no doubt already found, attempting to cast without augmenting results in an exception.

WebDriver driver = new RemoteWebDriver( ... );
driver           = new Augmenter().augment( driver );
( (TakesScreenshot)driver ).getScreenshotAs( ... );


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...