I am automating an Hybrid Android app using Node.js + Chai + Appium + SauceLabs.
In my app I have a button that opens a PDF file in the Android PDF viewer. The PDF opens alright, but when I go back, it goes to first page instead of the page I was before.
I use the following code:
it("Should click pdf file and go back'", function() {
return driver
.waitForElementByXPath('//*[@id="openPDF"]')
.click()
.deviceKeyEvent(4);
});
Is it a bug or by design? How can I solve it?