Development

In today’s quick software development world, it is important to keep apps high quality. A key part of this is software testing. Tosca automation is a strong tool that helps with this task. This blog, titled “Tosca Automation Tutorial: Model-Based Approach,” will cover the main points about Tosca. We will look into its new model-based
The post Tosca Automation Tutorial: Model-Based Approach appeared first on Codoid.

Since it’s election day in the US, many people are thinking about counting today. We frequently discuss counting here, and…

Open-source software has transformed the tech industry, creating powerful opportunities for learning, growth, and collaboration. By contributing to open-source projects,…

I have below code and it will dynamically inject optionName to a xpath.
And try to click on it.
getSortOptionByName(optionName: string) {
return $(`//android.widget.Button[@content-desc=”${optionName}”]`);
}

Below is the full code.
public async selectingEachSortOption(): Promise<void>
{
const sortOptions = await this.getAllTheAvailableSortOptions();
for(const sortItem of sortOptions){

await (await this.getSortOptionByName(sortItem)).waitForDisplayed({ timeout: 5000 });
await (await this.getSortOptionByName(sortItem)).waitForEnabled({ timeout: 5000 });
await (await this.getSortOptionByName(sortItem)).click();
this.clickOnSortByDropDown();
}
}

When I use this code in my test, It will iterate through the 1st loop.(I have 4 loops)
But at the 2nd loop, it will end with no errors and the test will mark as pass.
What are the possible mistakes I’m doing here?