While testing an power apps application on Katalon Studio, i am unable to open & select from the dropdown. The object captured through spy web is span_Select an item. We tried by using selectOptionByIndex, selectOptionByLabel, selectOptionByValue. Please let know if more information is required.
By searching Google with key “Power Apps automated test”, I found a blog by Microsoft:
where they describe how to build End-to-end tests for Power Apps using their “Test Studio” which is built-in the Power Apps authoring environment. This article is dated January 2020, which is 5 years old. I guess that Microsoft has done much more up until today.
How about creating the script based on user experience, rather than using reserved functions like selectOptionByIndex, selectOptionByLabel, or selectOptionByValue?
Instead, you could directly locate the text, for example:
Click on the dropdown text.
Once the dropdown appears, click on the value text.
On my project2, none of the drop-downs are <select> tags. Unfortunately for you, you have to create code to capture your “drop-down option”. Below is something that I might try:
import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
WebDriver driver = DriverFactory.getWebDriver();
strLevel = '...' // e.g. 1000
List<WebElement> templateLabel = driver.findElements(By.xpath('id("powerapps-flyout-react-combobox-view-7")//ul//li/div/span'));
WebUI.comment("found ${templateLabel.size()}")
for (int cnt = 0; cnt < templateLabel.size(); cnt++) {
if (templateLabel.get(cnt).getText() == strLevel) {
templateLabel.get(cnt).click()
break;
}
}
Now the example you show above is for just 4 options in this drop-down, I believe. However, if your drop-down has more options, like maybe 8 or more, then you may have to involve a slider component to move to “see” the lower options and it gets a bit more convoluted with maybe a “while” loop and a “scrollAmount” value.