Posted 21 April 2021, 10:40 pm EST
Hi AbuBakker,
You don’t add anything to the test complete script. You just need to expose the GC object in the project that you are testing so that test complete can access the GC object. Please refer to the following code snippet and let us know if you face any issues.
//add this to the React project
import * as GC from "@grapecity/spread-sheets"
window.GC = GC;
// TestComplete Script should be
function Test1()
{
//Opens the specified URL in a running instance of the specified browser.
Browsers.Item(btChrome).Navigate("https://www.grapecity.com/spreadjs/demos/sample/showcase/aging-report/purejs/");
Aliases.browser.BrowserWindow2.Maximize();
var page = Aliases.browser.Page("https://www.grapecity.com/spreadjs/demos/sample/showcase/aging-report/purejs/")
var document = page.contentDocument
var GC = page.contentDocument.Script.GC;
var spread = GC.Spread.Sheets.findControl(document.querySelector("div[gcUIElement='gcSpread']"))
Log.Message(spread.getActiveSheet().name())
}
Regards,
Avinash