Ask a Question

Headless execution

Regular Contributor

Headless execution

I am new to using headless execution with TC and am in the process of converting some existing tests to run headlessly. 

I am able to launch a headless browser using a script with no issues (Browsers.RemoteItem(server, capabilities).Run(url);)


Some of my Keyword tests have additional navigates within them using Navigate Current Browser.

What's the best way to handle these while still using a headless browser? Is it possible through a Keyword test using Operations?


It seems like I can call a script routine in place of the Navigate statement. But I would have to do this for all cases each with a different url. 


function headlessNavigate() {

var server = "localhost";
var capabilities = {
"browserName": "edge",
"screenResolution": "1920x1080"

var url = Project.Variables.url;
Browsers.RemoteItem(server, capabilities).Navigate(url)

Champion Level 3

You already have an extra call for your additional navigates. Calling a common function with the appropriate URL won't add anything extra, it will replace it. You just need to make that function one common to all the tests and call it with the needed URL from each test that needs it.

Regular Contributor

Thanks, yeah that's essentially what I ended up doing. 

Wrote a function that took in a URL parameter and then called it in tests that needed an additional navigate within the test. 

Showing results for 
Search instead for 
Did you mean: