Mind you, I cannot really post code snippits because it belongs to the company.

This is a NodeJS/DustJS (don’t ask) application, with a lot of configuration/moving parts. It essentially dynamically builds a form based on URL parameters that indicate exactly what the form is pointing to and what fields are necessary. We are running Mocha tests on Selenium/WebdriverIO with Saucelabs for regression testing, but now we’re trying to make the regression testing useful for cross browser, as we typically support Chrome.

Thing is, I’m very new to E2E testing in general as well as being new to Selenium. So I’m having trouble figuring out exactly where the tests are going wrong. The app has custom data attributes that the tests select for, but the templates or template generators (there are multiple strategies being employed to render certain pages, piece together certain attributes, etc) themselves are not explicit with exactly which elements have said data-attributes, plus the logging returns what appear to be unique Node ids rather than the element themselves, so I mostly have to check by watching playback on SauceLabs to see what is in focus (both to find what element has the attribute as making sure that the correct element for the test data is in focus). There is also the issue of commands randomly failing when they shouldn’t. Consulting my desk neighbor, he was saying that it could be timing, as there are a LOT of places where there are implicit waits used to prevent conflicts (kill me, even I know that’s a bad idea in a sea of async/awaits to have a bunch of variations of `WAIT_TIME`s)

Basically, I feel like there’s core information I’m missing that may shed some light. Or maybe all my questions are red herrings. I have no idea. But I could use some answers.

  • I don’t see anything in the code I’m working with that explicitly scrolls to the focused element. Does `WebElement.waitForVisible` do that?
  • What would cause a `sendKeys()` to be seen as an `UnsupportedCommandException`? What can cause anything to be an `UnsupportedCommandException` assuming that that same command had been used earlier in the test with no difficulties?
  • Is there a way to set Webdriver logging to log the physical element rather than just the Node id?
  • What do I need to ask my team to get me further on this? I feel like that’s such an obvious and broad question but I don’t know what I don’t know and if anyone has a similar experience that it turned out getting X context from your team was the clincher to figuring it out, I would love to explore that avenue

submitted by /u/SiouxsieAsylum
[link] [comments]