I'm trying to automate a workflow with MS Teams and I'm using WinAppDriver. I'm able to bring up Teams and WinAppDriver using the following code
String command = "C:\\Program Files (x86)\\Windows Application Driver\\WinAppDriver.exe";
ProcessBuilder winappDriver = new ProcessBuilder(command).inheritIO();
winappDriver.start();
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("app","C:\\Users\\Admin\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe");
But after starting up teams WinAppDriver cannot recognize the Add a Tab button with all the following functions
driver.findElementByName("Add a tab");
driver.findElementByXPath("//Button[@Name='Add a tab']");
driver.findElementByAccessibilityId("add-tab-button-v2")
This is the button I'm trying to click
And this what the inspect tool is showing me for this button
What am I doing wrong? Thank you!