configure webdriver

Set up an advanced test environment where you are going to run tests with WebDriver.
NameDescriptionTypeModifier
values

Set of keys and values, in JSON format, sent by the client to describe the capabilities that a new session created by the server should possess

StringNone
None
This action may be used within the following project items: test modules and user-defined actions.

Suppose that we'd like to launch Chrome in headless and webdriver mode. The desired capabilities should resemble the following:

        
            {"capabilities":{"browserName":"chrome"},"options":{"args":["--headless"]}}
        
    
  • capabilities: desired capabilities. (Learn more)
    • browserName: The name of the browser being used.
  • options: A list of all the specific desired capabilities.
    • args: list of command-line arguments to use when starting Chrome.
      • -headless: Run in headless mode, i.e., without a UI or display server dependencies.
Action lines
        
          	values
configure webdriver	{"capabilities":{"browserName":"chrome"},"options":{"args":["--headless"]}}
        
    

Besides, in GWD mode, you can decide whether or not to keep the browser open after test execution by using the clean upkey. See the example below for more information:

        
              	values
configure webdriver	{"cleanup":"no"}
        
    
  • yes (Default): close browser after test execution.
  • no: keep the browser open after test execution.
Sample code
            
                  	setting	value
setting	webdriver mode	on
	&nbsp	
	values	
configure webdriver	{"capabilities":{"browserName":"chrome"},"options":{"args":["--headless"]}}	
	&nbsp	
	location	
navigate	https://google.com	
	&nbsp	
	window	
check window exists	[doc title=Google]	
            
        
Result
  • The purpose of keeping the browser open is to help you to debug your test. Using it may cause some problems related to headless mode, multi-execution, un-rent devices, etc. Please be aware of this before using this setting.

Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400