Dummy Project on Demo QA using Katalon Studio : How do I go back to the default tab? if i automate testing using katalon

Viewed 19

I am a beginner in the field of quality assurance. I trained myself to do automated testing for dummy projects. In this case I use the Demo QA website.

I'm having trouble automating the Links feature in the elements menu.

The problem is, when I click Links Home, the web will lead directly to the homescreen page, even though the next test case is on the previous tab or the default tab.

This is the result of the record :

enter image description here

So currently the active tab is the page from the Links Home earlier.

enter image description here

This is the default tab that should be active

enter image description here

How do I go back to the default tab ?

1 Answers

I would suggest getting all the windows of the driver after opening the new window as a list: driver.getWindowHandles() and then switching the main driver to which ever window you prefer

For java:
private List allHandles = new ArrayList(driver.getWindowHandles());

and then choosing which I want my main driver to be:

driver.switchTo().window(allHandles.get(1));

You can switch the windows as your preference

Related