healenium / healenium-appium

Self-healing library for Appium-based tests
Apache License 2.0
26 stars 9 forks source link

Unable to apply driver wrapper to android driver #17

Closed kotakeerthi closed 3 years ago

kotakeerthi commented 3 years ago

Hi Team,

I want to introduce healenium-aapium in my java project in which I'll test android mobile apps.I followed the steps that were mentioned in README but unable to introduce healenium feature in my project. I'm facing error like "UNABLE TO CREATE WRAPPER OBJECT". Can you please help me with this by giving some more guidelines or a sample project in which healenium-appium is introduced.

Regards, Keerthi Kota

alxkor commented 3 years ago

Hello, Keerthi Kota!

Could you provide the error log of your project and the part of code where you tried to create AppiumDriver? So we will be able to detect you problem. Also you need to check, that all dependencies successfully imported into your project (see Maven or Gradle files). Before you run you project AppiumServer must be started and configured. Check that the settings of your AppiumServer correctly declared in your code. And if you don't want to use Docker, you can try old stable version (1.0.2 for example).

kotakeerthi commented 3 years ago

Hi Team,

Thank you for your reply ,here I'm attaching 4 screenshots in which 38398 is the console when I run test in local emulator and 36680 is the console when I run test on online emulator and other two screenshots are code block and dependency related one's.

On Wed, Dec 2, 2020, 19:21 alxkor notifications@github.com wrote:

Hello, Keerthi Kota!

Could you provide the error log of your project and the part of code where you tried to create AppiumDriver? So we will be able to detect you problem. Also you need to check, that all dependencies successfully imported into your project (look Maven of Gradle files).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/healenium/healenium-appium/issues/17#issuecomment-737242264, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHAE6OUYUGCMOHJZVLKH73SSZA45ANCNFSM4UKOQZ5A .

alxkor commented 3 years ago

Hi Team, Thank you for your reply ,here I'm attaching 4 screenshots in which 38398 is the console when I run test in local emulator and 36680 is the console when I run test on online emulator and other two screenshots are code block and dependency related one's.

I don't see anything in attachments. Try again, please.

kotakeerthi commented 3 years ago

Can you please check now

Screenshots.zip

alxkor commented 3 years ago

Can you please check now

Screenshots.zip

Ok, I will.

alxkor commented 3 years ago

Hello!

You have correct behavior on Screenshot (229).png You can use TestEmulatorCalcApp.java as an example to write your own test. Healenium's work based on successful runs of your tests and you need to provide correct test results to save in backend of filesystem before you could heal you locations by healenium.

kotakeerthi commented 3 years ago

Hello!

You have correct behavior on Screenshot (229).png You can use TestEmulatorCalcApp.java as an example to write your own test. Healenium's work based on successful runs of your tests and you need to provide correct test results to save in backend of filesystem before you could heal you locations by healenium.

Hi, I just used same calculator app you suggested and ,the xpath I wrote was working as expected normally,but if I apply driver wrapper it was getting failed for the first run itself.And I also noticed that appium is invoking app for two times when I apply wrapper to driver.it is invoking and getting closed for first time and for the second time it is throwing the error.i am attaching screenshot of that please check that help me with this. Regards Keerthi Screenshot (247)

alxkor commented 3 years ago

Hello! Check this example project: https://github.com/healenium/example_appium_mvn It must solve the problem.

MaheshRamchandra commented 2 years ago

Hello! Check this example project: https://github.com/healenium/example_appium_mvn It must solve the problem.

Hi @alxkor, Pls help me here. i imported the project example_appium_mvn and tried to run with appium studio, i got the invalid session id exception

[INFO] Running healenium.TestEmulatorCalcApp Jan 08, 2022 3:04:25 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0 INFO: Detected dialect: OSS Jan 08, 2022 3:05:36 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0 INFO: Detected dialect: OSS [ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 82.969 s <<< FAILURE! - in healenium.TestEmulatorCalcApp [ERROR] testFindElementsOk Time elapsed: 0.066 s <<< ERROR! org.openqa.selenium.NoSuchSessionException: invalid session id (A session is either terminated or not started (96fadd11-052b-4d73-853f-707a2d0b5f10), A session could be terminated due to the end of timeout specified by newCommandTimeout https://docs.experitest.com/display/AS/Timeout+Capabilities) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'MAHESHLAPTOP', ip: '172.25.80.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16.0.2' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {appActivity: .Calculator, appBuildVersion: , appPackage: com.android.calculator2, appReleaseVersion: , appiumVersion: 1.8.0, applicationClearData: false, autoAcceptAlerts: false, autoDismissAlerts: false, autoGrantPermissions: false, autoWebview: false, commandTimeouts: 120000, desired: {appActivity: .Calculator, appPackage: com.android.calculator2, deviceName: emulator-5554, platformName: android, test_data:testFindElementsOk:digit_7: testFindElementsHealed:digi..., test_data:testResultOk:result: testResultHealed:resul}, device.category: PHONE, device.majorVersion: 5, device.manufacture: HUAWEI, device.model: CUN-L22, device.name: CUN-L22, device.os: Android, device.screenSize: 720x1280, device.serialNumber: PNTBBCB690927198, device.version: 5.1, deviceName: emulator-5554, deviceUDID: PNTBBCB690927198, dontGoHomeOnQuit: false, dontStopAppOnReset: false, fullReset: false, install.only.for.update: false, installOnlyForUpdate: false, instrumentApp: false, javascriptEnabled: true, keystorePath: ~/.android/debug.keystore, locationServicesAuthorized: false, newSessionWaitTimeout: 600, noReset: false, platform: ANDROID, platformName: android, projectName: , reportDirectory: reports, reportFormat: xml, reportUrl: C:\Users\IGS0258\appiumstud..., reservationDuration: 240, takeScreenshots: true, test.type: Mobile, testName: mobile test 01/08/22 03:04 PM, test_data:testFindElementsOk:digit_7: testFindElementsHealed:digi..., test_data:testResultOk:result: testResultHealed:resul, udid: PNTBBCB690927198, useKeystore: false, waitForDeviceTimeout: 120000} Session ID: 96fadd11-052b-4d73-853f-707a2d0b5f10 *** Element info: {Using=id, value=digit_7} at healenium.TestEmulatorCalcApp.testFindElementsOk(TestEmulatorCalcApp.java:80)

[ERROR] testResultOk Time elapsed: 0.009 s <<< ERROR! org.openqa.selenium.NoSuchSessionException: invalid session id (A session is either terminated or not started (96fadd11-052b-4d73-853f-707a2d0b5f10), A session could be terminated due to the end of timeout specified by newCommandTimeout https://docs.experitest.com/display/AS/Timeout+Capabilities) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'MAHESHLAPTOP', ip: '172.25.80.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16.0.2' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {appActivity: .Calculator, appBuildVersion: , appPackage: com.android.calculator2, appReleaseVersion: , appiumVersion: 1.8.0, applicationClearData: false, autoAcceptAlerts: false, autoDismissAlerts: false, autoGrantPermissions: false, autoWebview: false, commandTimeouts: 120000, desired: {appActivity: .Calculator, appPackage: com.android.calculator2, deviceName: emulator-5554, platformName: android, test_data:testFindElementsOk:digit_7: testFindElementsHealed:digi..., test_data:testResultOk:result: testResultHealed:resul}, device.category: PHONE, device.majorVersion: 5, device.manufacture: HUAWEI, device.model: CUN-L22, device.name: CUN-L22, device.os: Android, device.screenSize: 720x1280, device.serialNumber: PNTBBCB690927198, device.version: 5.1, deviceName: emulator-5554, deviceUDID: PNTBBCB690927198, dontGoHomeOnQuit: false, dontStopAppOnReset: false, fullReset: false, install.only.for.update: false, installOnlyForUpdate: false, instrumentApp: false, javascriptEnabled: true, keystorePath: ~/.android/debug.keystore, locationServicesAuthorized: false, newSessionWaitTimeout: 600, noReset: false, platform: ANDROID, platformName: android, projectName: , reportDirectory: reports, reportFormat: xml, reportUrl: C:\Users\IGS0258\appiumstud..., reservationDuration: 240, takeScreenshots: true, test.type: Mobile, testName: mobile test 01/08/22 03:04 PM, test_data:testFindElementsOk:digit_7: testFindElementsHealed:digi..., test_data:testResultOk:result: testResultHealed:resul, udid: PNTBBCB690927198, useKeystore: false, waitForDeviceTimeout: 120000} Session ID: 96fadd11-052b-4d73-853f-707a2d0b5f10 *** Element info: {Using=id, value=digit2} at healenium.TestEmulatorCalcApp.testAddOperation(TestEmulatorCalcApp.java:91) at healenium.TestEmulatorCalcApp.testResultOk(TestEmulatorCalcApp.java:67)

[ERROR] testResultHealed Time elapsed: 0.014 s <<< ERROR! org.openqa.selenium.NoSuchSessionException: invalid session id (A session is either terminated or not started (96fadd11-052b-4d73-853f-707a2d0b5f10), A session could be terminated due to the end of timeout specified by newCommandTimeout https://docs.experitest.com/display/AS/Timeout+Capabilities) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'MAHESHLAPTOP', ip: '172.25.80.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16.0.2' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {appActivity: .Calculator, appBuildVersion: , appPackage: com.android.calculator2, appReleaseVersion: , appiumVersion: 1.8.0, applicationClearData: false, autoAcceptAlerts: false, autoDismissAlerts: false, autoGrantPermissions: false, autoWebview: false, commandTimeouts: 120000, desired: {appActivity: .Calculator, appPackage: com.android.calculator2, deviceName: emulator-5554, platformName: android, test_data:testFindElementsOk:digit_7: testFindElementsHealed:digi..., test_data:testResultOk:result: testResultHealed:resul}, device.category: PHONE, device.majorVersion: 5, device.manufacture: HUAWEI, device.model: CUN-L22, device.name: CUN-L22, device.os: Android, device.screenSize: 720x1280, device.serialNumber: PNTBBCB690927198, device.version: 5.1, deviceName: emulator-5554, deviceUDID: PNTBBCB690927198, dontGoHomeOnQuit: false, dontStopAppOnReset: false, fullReset: false, install.only.for.update: false, installOnlyForUpdate: false, instrumentApp: false, javascriptEnabled: true, keystorePath: ~/.android/debug.keystore, locationServicesAuthorized: false, newSessionWaitTimeout: 600, noReset: false, platform: ANDROID, platformName: android, projectName: , reportDirectory: reports, reportFormat: xml, reportUrl: C:\Users\IGS0258\appiumstud..., reservationDuration: 240, takeScreenshots: true, test.type: Mobile, testName: mobile test 01/08/22 03:04 PM, test_data:testFindElementsOk:digit_7: testFindElementsHealed:digi..., test_data:testResultOk:result: testResultHealed:resul, udid: PNTBBCB690927198, useKeystore: false, waitForDeviceTimeout: 120000} Session ID: 96fadd11-052b-4d73-853f-707a2d0b5f10 *** Element info: {Using=id, value=digit2} at healenium.TestEmulatorCalcApp.testAddOperation(TestEmulatorCalcApp.java:91) at healenium.TestEmulatorCalcApp.testResultHealed(TestEmulatorCalcApp.java:74)

[ERROR] testFindElementsHealed Time elapsed: 0.014 s <<< ERROR!