WeSearch

Keep Appium out of your test code: BasePage + lazy locators

·2 min read · 0 reactions · 0 comments · 15 views
#automation#testing#java#android
Keep Appium out of your test code: BasePage + lazy locators
TL;DR · WeSearch summary

The article discusses the importance of decoupling test code from Appium by using an abstraction layer. It introduces a BasePage class and lazy locators to improve test maintainability. This approach allows tests to focus on their intent without being affected by changes in the underlying driver setup.

Key facts
Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3916371) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Mayvin Ramasawmy Posted on May 26 Keep Appium out of your test code: BasePage + lazy locators #android #automation #java #testing If your test methods import AndroidDriver, call findElement directly, or know what a locator strategy is, your tests are coupled to Appium. The day a selector changes or the driver setup moves, that coupling spreads the edit across every test you've written. The fix is an abstraction layer your tests talk to instead.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)