Screenshot:
I am trying to use the element ID in appium to automate click menu button. It is not set by default and it shows NULL without element ID or Text it is not possible. Could anyone help me in this?
Screenshot:
I am trying to use the element ID in appium to automate click menu button. It is not set by default and it shows NULL without element ID or Text it is not possible. Could anyone help me in this?
You can use this:
driver.findElementByName("Open navigation drawer").click();
OR
driver.findElementByXPath("//*[@class='android.widget.ImageButton' and @content-desc='Open navigation drawer']").click();
You can always find element by XPath, it could be done by:
@FindBy(xpath = "//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.TextView[1]")
private WebElement elementName;
driver.findElementByXPath("putXpathHere");
XPath of an element can be found in Appium's inspector below the ID.
If you want to use IDs instead of xpath in this case, I'm afraid you will have to add resource id's inside the application code.
You can click Hamburger icon using it content description. Like this:
driver.findElementByAccessibilityId("Open navigation drawer").click();