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.
Were you able to find the solution you needed in this thread? If yes, then could you mark one of the replies as a solution , so that other members can refer to it in the future?
If not yet, then please follow up with others so you can work towards a solution to your question.
One other thing you did not mention is if you have dynamic <id> within your application. If you do, then likely the pathway I used above will not work as you will get a different <id> every time you start it. However, maybe you can use part of the pathway, like: