Title: Using sendKeys sometimes results in InvalidElementState · Issue #279 · NativeScript/nativescript-dev-appium · GitHub
Open Graph Title: Using sendKeys sometimes results in InvalidElementState · Issue #279 · NativeScript/nativescript-dev-appium
X Title: Using sendKeys sometimes results in InvalidElementState · Issue #279 · NativeScript/nativescript-dev-appium
Description: I'm using the following packages (tns info output) on Linux (Debian Jessie) ✔ Getting NativeScript components versions information... ✔ Component nativescript has 6.2.0 version and is up to date. ✔ Component tns-core-modules has 6.2.1 ve...
Open Graph Description: I'm using the following packages (tns info output) on Linux (Debian Jessie) ✔ Getting NativeScript components versions information... ✔ Component nativescript has 6.2.0 version and is up to date. ✔...
X Description: I'm using the following packages (tns info output) on Linux (Debian Jessie) ✔ Getting NativeScript components versions information... ✔ Component nativescript has 6.2.0 version and is up to dat...
Opengraph URL: https://github.com/NativeScript/nativescript-dev-appium/issues/279
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using sendKeys sometimes results in InvalidElementState","articleBody":"I'm using the following packages (tns info output) on Linux (Debian Jessie)\r\n✔ Getting NativeScript components versions information...\r\n✔ Component nativescript has 6.2.0 version and is up to date.\r\n✔ Component tns-core-modules has 6.2.1 version and is up to date.\r\n✔ Component tns-android has 6.2.0 version and is up to date.\r\n✔ Component tns-ios has 6.2.0 version and is up to date.\r\n\r\nI'm running on Android 7.0\r\n\r\nThe problem I'm having is when I try and sendKeys to an element on a tab or too low on the screen I get the following error;\r\n\r\n Error: [element.sendKeys(\"Rasberry PI\")] Error response status: 12, InvalidElementState - An element command could not be completed because the element is in an invalid state (e.g. attempting to click a disabled element). Selenium error: Cannot set the element to 'Rasberry PI'. Did you interact with the correct element?\r\n\r\nMy element on a tab looks like this;\r\n\r\n \u003cTabContentItem\u003e\r\n \u003cStackLayout orientation=\"vertical\"\u003e\r\n \u003cLabel text=\"Make\"\u003e\u003c/Label\u003e\r\n \u003cTextField automationText=\"make\" hint=\"Make\" [(ngModel)]=\"_assetItem.make\" class=\"input\"\u003e\u003c/TextField\u003e\r\n \u003c/TabContentItem\u003e\r\n\r\nMy test looks like this;\r\n\r\nimport { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from \"nativescript-dev-appium\";\r\nimport { assert } from \"chai\";\r\n\r\nconst addContext = require('mochawesome/addContext');\r\n\r\ndescribe(\"Asset Create\", () =\u003e {\r\n let driver: AppiumDriver;\r\n\r\n before(async function(){\r\n nsCapabilities.testReporter.context = this; \r\n driver = await createDriver(); // wait for the driver instance to be created\r\n });\r\n\r\n after(async function () {\r\n await driver.quit(); // destroy the driver instance\r\n console.log(\"Quit driver!\");\r\n });\r\n\r\n afterEach(async function () {\r\n if (this.currentTest.state === \"failed\") {\r\n await driver.logTestArtifacts(this.currentTest.title);\r\n }\r\n });\r\n\r\n describe(\"After login\", () =\u003e {\r\n\r\n before(async function () {\r\n // Enter user\r\n const nameField = await driver.findElementByAccessibilityId(\"email\");\r\n await nameField.sendKeys(\"test@pais.com.au\");\r\n\r\n // Enter password\r\n const passwordField = await driver.findElementByAccessibilityId(\"password\");\r\n await passwordField.sendKeys(\"testmobile\");\r\n\r\n // Login\r\n const btnLoginTap = await driver.findElementByAccessibilityId(\"btnLogin\");\r\n await btnLoginTap.click();\r\n });\r\n \r\n afterEach(async function () {\r\n // Nav to Home\r\n const btnHomeNavTap = await driver.findElementByAccessibilityId(\"btnHome\");\r\n await btnHomeNavTap.click();\r\n });\r\n\r\n it.only(\"creates new asset\", async function () {\r\n // Nav to New Asset \r\n const btnManualNavTap = await driver.findElementByAccessibilityId(\"btnNewAsset\");\r\n await btnManualNavTap.click();\r\n\r\n // Check heading\r\n const lblHeadingManual = await driver.findElementByAccessibilityId(\"headingAssetForm\");\r\n assert.equal(await lblHeadingManual.text(), \"New Asset\");\r\n\r\n const tabDetails = await driver.findElementByAutomationText(\"tabDetails\");\r\n await tabDetails.click();\r\n\r\n const makeField = await driver.findElementByAutomationText(\"make\");\r\n await makeField.sendKeys(\"Rasberry PI\");\r\n\r\n\r\nI expected it to type the text \"Raspberry PI\" into the 'make' field, but instead nothing happens and I get an error from my End to End test. The after block still runs.\r\n\r\nI've tried the following\r\n\r\nwaiting for the field\r\n\r\n await makeField.waitForExist(1000);\r\n\r\nClick on it first\r\n\r\n const makeField = await driver.findElementByAutomationText(\"make\");\r\n await makeField.click();\r\n await makeField.sendKeys(\"Rasberry PI\");\r\n\r\nSending through adb instead\r\n\r\n await makeField.sendKeys(\"Rasberry PI\", true, true);\r\n\r\nError\r\n\r\n Error: [execute(\"mobile: shell\",{\"command\":\"input\",\"args\":[\"keyevent\",67]})] Error response status: 13, , UnknownError - An unknown server-side error occurred while processing the command. Selenium error: An unknown server-side error occurred while processing the command. Original error: Potentially insecure feature 'adb_shell' has not been enabled. If you want to enable this feature and accept the security ramifications, please do so by following the documented instructions at https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/security.md\r\n\r\nI can write to some TextFields if they are at the top of a screen and on the first tab. As soon as I go to the second tab I cannot type in the fields. I also cannot type in fields which are too low on the screen. I had a vertical stack of 4 fields all with labels above and I couldn't sendKeys to the last field, but if I removed some of the labels which moved the field up then I could.","author":{"url":"https://github.com/map7","@type":"Person","name":"map7"},"datePublished":"2019-11-14T05:05:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/279/nativescript-dev-appium/issues/279"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a4143578-f356-c296-913b-b316cc741832 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B28:3B954A:620D74:821EF6:6A5B342C |
| html-safe-nonce | 91c2f8e76b488ee02e506483d78e20114c728d48ad4fc870ff5dc11cc1f83010 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjI4OjNCOTU0QTo2MjBENzQ6ODIxRUY2OjZBNUIzNDJDIiwidmlzaXRvcl9pZCI6Ijg2OTkxNzU5NDg3OTE3ODg1ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8abbb2033ce34ff97ea0628f23cb71d5b81334c1c32b5f6c199dbf1e4dbd3bbd |
| hovercard-subject-tag | issue:522627169 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-dev-appium/279/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6d50a926a6b967818c369d1c3ac5968fb254ae88422608bd0f0865421d9f50f1/NativeScript/nativescript-dev-appium/issues/279 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6d50a926a6b967818c369d1c3ac5968fb254ae88422608bd0f0865421d9f50f1/NativeScript/nativescript-dev-appium/issues/279 |
| og:image:alt | I'm using the following packages (tns info output) on Linux (Debian Jessie) ✔ Getting NativeScript components versions information... ✔ Component nativescript has 6.2.0 version and is up to date. ✔... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | map7 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-dev-appium git https://github.com/NativeScript/nativescript-dev-appium.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 58553304 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-dev-appium |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 58553304 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-dev-appium |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width