jmeter how to add chromedriver extension in chrome profile - webdriver

I am doing
WDS.AddExtension(Path.GetFullPath("Ghostery_v5.4.1.crx"));
I know its wrong Please let me know in jmeter how to add chromedriver extension in chrome profile
Stacktrace in jmeter
2015/01/27 12:03:52 INFO - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: Current thread name: 'xxxxx1-1', has browser: 'ChromeDriver: chrome on XP (606ce1d4c34688e1062579fd676f16a7)'
2015/01/27 12:03:52 ERROR - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Cannot find function AddExtension in object com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverScriptable#3a0ee49f. (<Unknown source>#1) in <Unknown source> at line number 1
xxxx

I am not sure how to work with JMeter and webdriver but in webdriver it is fairly as simple as
var chromeOptions = new ChromeOptions();
chromeOptions.AddExtension("something.crx");

Related

WebDriverManagerException when using WebDriverManager for selenium

I am using WebDriverManager api to initiate browser. I am using the following code to connect to chrome browser.
WebDriverManager.chromedriver().setup()
Exception is:
io.github.bonigarcia.wdm.config.WebDriverManagerException: java.security.KeyStoreException: problem accessing trust storejava.io.IOException: Invalid keystore format
at io.github.bonigarcia.wdm.online.HttpClient.<init>(HttpClient.java:117)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:490)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277)
Caused by: java.security.KeyStoreException: problem accessing trust storejava.io.IOException: Invalid keystore format
at sun.security.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java:74)
at javax.net.ssl.TrustManagerFactory.init(TrustManagerFactory.java:250)
at org.apache.hc.core5.ssl.SSLContextBuilder.loadTrustMaterial(SSLContextBuilder.java:201)
at io.github.bonigarcia.wdm.online.HttpClient.<init>(HttpClient.java:99)
Anyone has any idea about this.
WebDriverManager version 4.0.0
ChromeBrowser 83
selenium version : 3.14.0

Robotframework and Saucelabs integration

I am trying to integrate my robotframework test with saucelabs. I just used open browser keyword and passed the remote url and desired capabilities values.
Open Browser https://saucelabs.com/ ie remote_url=${REMOTE_URL} desired_capabilities=browserName:internet explorer,version:9.0,platform:Windows 7
Got the below error
Opening browser 'ie' to base url 'https://saucelabs.com/' through
remote server at 'desired_capabilities=browserName:internet
explorer,version:9.0,platform:Windows 7' failed [ WARN ] Can't take
screenshot. No open browser found | FAIL |
java.net.MalformedURLException: no protocol:
desired_capabilities=browserName:internet
explorer,version:9.0,platform:Windows 7
I tried to pass the desired capabilities in different format and got the same error. This framework is set up in eclipse using jython.
Open Browser https://saucelabs.com/ browserName=ie remoteUrl=${REMOTE_URL} desiredCapabilities=platform:Windows 7,browserName:internet explorer,version:9.0,username:${username},accessKey:${accessKey}
Define/pass the values of the variables before using the above statement.

how to resolve Appium bad parameters error

I am stuck at the error when the appium server shows error
[MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","capabilities","sessionId","id"]} and you sent ["desiredCapabilities","requiredCapabilities","capabilities","alwaysMatch","firstMatch"]
In the eclipse it shows error
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=C:\Users\Admin\workspace\Sling_App\src\app-dev-debug.apk}], required capabilities = Capabilities [{}]
I have been using 5.0.0 and also 4.1.2 client jar
Tried with Selenium 3 , 3.3
Appium Server I tried on are 1.6.2 , 1.6.3 and latest 1.6.4
Nothing Solves the problem ,
I read most of the articles related to this , but of no use
Please tell if any 1 has found solution to thisenter image description here
In ideal case we need to pass 6 capabilities(for APK testing) as below,
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","ANDROID");
capabilities.setCapability("platformVersion", "5.1");
capabilities.setCapability("platformName",Constant.appPlatform);
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", Constant.appPackage);
capabilities.setCapability("appActivity",Constant.appActivity);
Also initiate appium webdriver instead of Android as below,
AppiumDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4727/wd/hub"), capabilities);
I am using appium 1.6.4 and java client 4.12 with selenium stand alone 2.53.1.
AppPackage/AppActivity are required for simulator also.
Hope this helps you.
Thanks.

inconsistent behavior in RSelenium

On Linux, the RSelenium/Selenium seems to be behaving erratically. I start the server manually and it seems to start up fine. Sometimes I am able to connect to it from my R session and other times I get an error. I cannot yet pinpoint the cause: the same script seems to work sometimes and not other times. Any ideas?
Here is the output from starting the server:
12:41:25.811 INFO - Launching a standalone server
12:41:26.102 INFO - Java: Sun Microsystems Inc. 11.0-b16
12:41:26.102 INFO - OS: Linux 2.6.32-431.17.1.el6.x86_64 amd64
12:41:26.157 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
12:41:26.492 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
12:41:26.589 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
12:41:26.589 INFO - Version Jetty/5.1.x
12:41:26.590 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
12:41:26.590 INFO - Started HttpContext[/selenium-server,/selenium-server]
12:41:26.590 INFO - Started HttpContext[/,/]
12:41:36.597 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#2993a66f
12:41:36.598 INFO - Started HttpContext[/wd,/wd]
12:41:36.601 INFO - Started SocketListener on 0.0.0.0:4444
12:41:36.601 INFO - Started org.openqa.jetty.jetty.Server#6f507fb2
The error I receive in my R session:
Couldnt connect to host on http://localhost:4444/wd/hub.
Please ensure a Selenium server is running.Error in queryRD(paste0(serverURL, "/session"), "POST", qdata = toJSON(serverOpts))
Other times, running the exact same script everything proceeds successfully. It could be a difference of what computer node actually executes the script but I cannot tell what the problem is when it will not connect.
library(RCurl)
library(RJSONIO)
library(XML)
# running selenium
system("java -jar selenium-server-standalone-2.44.0.jar")
I faced same issue and try to run above code. Finally know that there only support 1.7 but not 1.8 as time being. You might try to download jre7 and jdk7.
I faced the same error in Mac, but I noticed that due to security settings the system does not let me to run the file with that piece of code. I downloaded the selenium standalone file and using control key I single-clicked the file and then from the menu I chose the open. Then the problem get solved.

How to run webdriver tests in Selenium Grid linux and firefox

How to run webdriver tests in Selenium Grid linux and firefox. After setting up the selenium Grid and registering the node with the hub when i try to run the below code throws class not found error, any thoughts.
URL server = new URL("http://127.0.0.1:4444/wd/hub");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setBrowserName("firefox");
System.out.println("Connecting to " + server);
RemoteWebDriver driver = new RemoteWebDriver(server, capabilities);
driver.get("http://www.google.com");
driver.quit();
Satish, check the error in stack trace. It says
Caused by: java.lang.ClassNotFoundException: com.app.tests.RemoteTest
This is NOT a selenium exception. Your class file RemoteTest is not in the classpath.You need to set it in the classpath.
You could try:
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
I assume Firefox is installed correctly and your node has a matching firefox instance?
Could you post your config files?

Resources