Appium version: Appium v1.7.1
Capabilities:
{
browserName: '',
'appium-version': '1.7.1',
platformName: 'Android',
platformVersion: '7.0',
deviceName: 'Android Emulator',
appPackage: "com.example.android",
appActivity: ".MainActivity",
avd: "Nexus_5X_API_24",
avdLaunchTimeout: 300000,
avdReadyTimeout: 300000
}
The following are the logs which result when i try to get the page source.
Log:
[debug] [MJSONWP] Calling AppiumDriver.getPageSource() with args: ["25bc4dbc-5f8b-458d-a28a-d9c09e3e48ba"]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"source","params":{}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"source","params":{}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: source
It gets stuck here. and no more logs are produced which means its waiting like forever here.
Code:
let source = await driver.source();
console.log("source: ", source);
My script works like this:
// the following code works perfectly fine (for logging in to the app)
let loginBtn = await driver.elementById("com.example.android:id/login_btn");
await loginBtn.click();
let usernameInput = await driver.elementById("com.example.android:id/login_user");
await usernameInput.click();
await usernameInput.sendKeys(program.username);
let passwordInput = await driver.elementById("com.example.android:id/password");
await passwordInput.click();
await passwordInput.sendKeys(program.password);
let loginSubmitBtn = await driver.elementById("com.example.android:id/submit_btn");
await loginSubmitBtn.click();
// ... now after login, a ListView element is loaded which has my target element. At this point, the call to get page source is never completed and takes forever.
// code execution is stuck at the following line
let source = await driver.source(); // takes forever. also tried locating the target element here which is not found
I can confirm it works fine using Appium Inspector
and this is my first time trying appium.