Skip to content

Incorrect equals check for "microsoft edge" browser if driver instance is of RemoteWebDriver in takeFullPageScreenshot method in Browser class #92

Closed
@racchouhan12

Description

@racchouhan12

For MicrosoftEdge when I run on BrowserStack, RemoteWebDriver is used and screenshot which I get has overlapping as header in my page is fixed.
After debugging I noticed that when WebDriver is instance of RemoteWebDriver, the browser name I am getting is "msedge" not "MicrosoftEdge" hence takeFullPageScreenshot is not working as expected for MicrosoftEdge.
Here is the code from Browser class:

public BufferedImage takeFullPageScreenshot() { this.driver = this.unwrapDriver(); if (!(this.driver instanceof ChromeDriver) && !(this.driver instanceof EdgeDriver)) { if (this.driver instanceof FirefoxDriver) { return this.takeFullPageScreenshotGeckoDriver(); } else { if (this.driver instanceof RemoteWebDriver) { if (((RemoteWebDriver)this.driver).getCapabilities().getBrowserName().equals("chrome") || ((RemoteWebDriver)this.driver).getCapabilities().getBrowserName().equals("MicrosoftEdge")) { return this.takeFullPageScreenshotChromeCommand(); }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions