We should avoid hard coding of paths in tests as this adds to portability of test from one machine other.
Locator Strategy for native mobile apps IDs and accessibility locators are still king. NSPredicate (iOS) and UIAutomator (Android) are great—mainly better than XPath —but they do not beat a good accessibility id or resource-id . And CSS selectors don’t exist for native apps (only for WebViews). Locator Strategy Ranking Rank iOS (native) Android (native) Why 1 Accessibility ID → name / label (via MobileBy.AccessibilityId or @iOSXCUITFindBy(accessibility = "Mehr anzeigen") ) Accessibility ID → content-desc (via MobileBy.AccessibilityId ) or @AndroidFindBy(accessibility = "Letzte Aktivitäten, Ăberschrift") ) Fast, readable, stable when set intentionally; improves a11y. 2 Stable identifiers (rare on iOS) resource-id (via new UiSelector().resourceId(...) ) or @AndroidFindBy(id = "load_more") id is just shorthand for matching the native Android resource-id attribute. Appium automatically maps id → resource-id If you pass only "load_more"...
FYI: You can use Environment("varname"), you don't need the ".Value".
ReplyDeleteGood work otherwise!
How can we follow same practice in Selenium Automation Project?
ReplyDeleteExample: System.setProperty("webdriver.chrome.driver",
"D:/automation/myproject/src/chromedrivers/win7/chromedriver_2.exe"); or in pom.xml
C:/Users/OfficePC21/workspace/deletexslt/testxslt/testng.xml