简体   繁体   中英

How to Disable "Chrome --disable-web-security" in Jmeter Webdriver Sampler?

We are trying to Performance Test one of our web Applications which has Security feature enabled using JMeter and we are unable to pass Chrome --disable-web-security<\/strong> in webdriver Sampler and was wondering do we have any option to pass Chrome --disable-web-security<\/code> when the webdriver sampler launches the chrome Browser ?

Unfortunately you cannot, you can ask WebDriver Sampler plugin developers or maintainers to include this option into one of the future releases via JMeter Plugins Support Forum

In the meantime you can switch to JSR223 Sampler and write your Selenium-related code in Groovy language , it will give you full control and flexibility, example code:

System.setProperty('webdriver.chrome.driver', '/path/to/chromedriver')

def options = new org.openqa.selenium.chrome.ChromeOptions()
options.addArguments('--disable-web-security')

def chromedriver = new org.openqa.selenium.chrome.ChromeDriver(options)
chromedriver.get('http://example.com')

Enabling the Chrome Driver Config Option, "Allow Insecure Certs" worked well for my requirement.Could be worth a try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM