Jmeter - Selenium for Chrome browser in Incognito

162 views
Skip to first unread message

Rajesh Kumar

unread,
Oct 4, 2017, 9:56:04 AM10/4/17
to Selenium Users
Hi - Any one tried Firing Jmeter - Selenium for Chrome browser in Incognito ???

I have been trying but no luck please suggest if any thing is missing.

var pkg=JavaImporter(org.openqa.selenium,org.openqa.selenium.support.ui) //import java selenium packages
var pkg1=JavaImporter(org.openqa.selenium.Capabilities,org.openqa.selenium.chrome.ChromeOptions)
var pkg2=JavaImporter(org.openqa.selenium.remote.CapabilityType,org.openqa.selenium.remote.DesiredCapabilities)
var Thr=JavaImporter(java.lang.Thread)
var wait = new pkg.WebDriverWait(WDS.browser,60)
//DesiredCapabilities capabilities = DesiredCapabilities.chrome()
//capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"))
//WebDriver driver = new ChromeDriver(capabilities)
//var wait = new pkg.WebDriverWait(WDS.browser,30) //import WebDriverWait Package

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"));
WebDriver driver = new ChromeDriver(capabilities);

driver = new ChromeDriver(service, options)


WDS.sampleResult.sampleStart() //sample starting point

WDS.browser.get('https://google.com')
WDS.sampleResult.sampleEnd()

let me know if any tried this successfully.

leo vince

unread,
Oct 5, 2017, 12:22:25 AM10/5/17
to Selenium Users

This works on python:

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--incognito")
driver = webdriver.Chrome('/usr/local/share/chromedriver',chrome_options=chrome_options)

L.

David

unread,
Oct 5, 2017, 3:55:34 PM10/5/17
to Selenium Users
Have you tried the code in Java (w/o the JMeter JavaImporter) outside JMeter? To make sure it works normally before trying the JMeter integration.

What issue do you see in the JMeter integration? Fails to launch or it launches but not incognito?


On Wednesday, October 4, 2017 at 6:56:04 AM UTC-7, Rajesh Kumar wrote:

leo vince

unread,
Oct 5, 2017, 6:01:21 PM10/5/17
to seleniu...@googlegroups.com
Nope, I thought you might be interested in seeing a working example  and perhaps adapt it to Java Wich I don't do.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/8BbFn5IGr9U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6b2fc34b-a8fa-41e7-b671-84282465d441%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David

unread,
Oct 6, 2017, 3:34:13 PM10/6/17
to Selenium Users
Well, the jmeter code is pretty much java with some jmeter framework wrapping around it. Hence why I asked the question. You want to narrow down your problem on whether it's java related or jmeter integration related. harder to tell if you don't do that.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages