Created
September 9, 2022 16:33
How To Identify Locators In Appium? [With Examples]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.testng.Assert.assertTrue; | |
import java.net.MalformedURLException; | |
import com.github.wasiqb.appium.pages.IOSLocators; | |
import org.testng.annotations.BeforeClass; | |
import org.testng.annotations.Test; | |
public class LocatorsIOSTest extends BaseTest { | |
private IOSLocators page; | |
@BeforeClass (alwaysRun = true) | |
public void setupClass () throws MalformedURLException { | |
this.driver = DRIVER_MANAGER.getIosDriver (); | |
this.page = new IOSLocators (); | |
} | |
@Test | |
public void testByAccessibilityId () { | |
assertTrue (getElement (this.page.getColorByAccessibilityId (), "Accessibility Id").isDisplayed ()); | |
} | |
@Test | |
public void testByClassChain () { | |
assertTrue (getElement (this.page.getColorByClassChain (), "Class Chain").isDisplayed ()); | |
} | |
@Test | |
public void testByPredicate () { | |
assertTrue (getElement (this.page.getColorByPredicate (), "Predicate").isDisplayed ()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment