Skip to main content
February 2, 2024
Question

How to switch tabs and have Fitnesse load correct DOM?

  • February 2, 2024
  • 9 replies
  • 0 views

It's critical to be able to tell Fitnesse to reload the DOM and move to a tab that is opened by the application.  How do we do this in Fitnesse?

Please don't include any UX recommendations for not opening new tabs just looking for an answer as to whether it's possible and if so how.

Here is the same question with no answer from 5 years ago.

 [mention:b91cee8a40da4dec91d2b850668d8c3c:46448885d0e64133bbfbf0cd7b0fd6f7] 

9 replies

March 18, 2024

Hey Reid, I am running into the same issue. I have seen people suggesting to use Java to create a custom class/method to switch to the new tab but I am having issues getting it to run.

Did you by any chance find a solution to this?

davidj137213
Brainy
March 18, 2024

What kind of issues are you experiencing? Maybe we can help if you facilitate more info about them

March 18, 2024

Hey David. Thanks for the reply.

So I created a java class using selenium, exported it as JAR and saved it in "/lib" folder along with the other JAR files. I tried calling it into the FitNesse script using the following syntax, where "appianTest" is the package name, "openSite" is the class name and "getSite" is the method name.

!|script                                                |
|appianTest.openSite|getSite|with|https://www.google.com|


But I run into "could not find class" error.

For reference this is the Java code I am using.

package appianTest;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class openSite {
	
	public void getSite(String URL) {

		WebDriver driver = new ChromeDriver();

		driver.get(URL);
	
}
}



This is just a test code to see if I could create the custom Java class get it to work in FitNesse and not the code to switch tabs.