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?
Related
I'm trying to use this line:
WebDriver driver = new ChromeDriver();
but I'm getting cannot be resolved to a type error for both classes.
What library am I supposed to import?
Download chromedriver from below URL :-
https://chromedriver.storage.googleapis.com/index.html?path=2.31/
Full code will be like below :-
System.setProperty("webdriver.chrome.driver","D:\\Workspace\\JmeterWebdriverProject\\src\\lib\\chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(chromeOptions);
driver.get("https://www.google.co.in/");
Edit the path of gecko driver as per your location of geckodriver
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.
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");
I have created a C# console project using Visual Studio 2008 and OracleClient (OCI) libraries to connect to a Oracle 11g database. This code works in Windows. I copied the whole project into Linux and Open the solution using MonoDevelop 4.2.3. But while running the project, the Database Open call throws an exception
string connectionString = "Data Source=Test; User ID=UID; Password=PWD"
OracleConnection conn = new OracleConnection()
conn.ConnectionString = connectionString;
conn.Open();
Exception:
System.DllNotFoundException: libclntsh.so at (wrapper
managed-to-native)
System.Data.OracleClient.Oci.OciCalls/OciNativeCalls:OCIEnvCreate
The libclntsh.so file is under the location /home/dbuser/instantclient_12_1
I have set the environment variable by adding the below in the /home/dbuser/.bashrc file and rebooted the system.
export
LD_LIBRARY_PATH=/home/dbuser/instantclient_12_1:$LD_LIBRARY_PATH
But still I am getting the same error. I couldn't find any option to include the Libraries in the MonoDevelop.
Thanks
Looks like LD_LIBRARY_PATH environment variable is not set up correctly or does not get applied.
Try creating additional linker configuration file instead with the following command:
echo /home/dbuser/instantclient_12_1 > /etc/ld.so.conf.d/instantclient.conf
Then as root update linker cache with command:
ldconfig
Restart MonoDevelop and try again.
I have resolved the issue by doing the following
echo $ORACLE_HOME/lib > /etc/ld.so.conf.d/dbconf.conf
set the$ORACLE_HOME, $ORACLE_INCLUDE_PATH and $ORACLE_LIB_PATH to
/etc/profile.d
Because of some reason MonoDevelop IDE is not picking the library libclntsh.so if I use the OCI client libraries
Well I'm new to to stackoverflow so I'm sorry if I misinterpreted some of this Q&A rules feel free to point out any mistake, and for my English, since I'm not an English native speaker.
Now, although I program for several years, I've been forced to use an old version of JDeveloper on this project I'm in, and I've had some beginner issues, because I'm used to let the IDE do all the hard work.
My objective is, to compile my project to a jar and execute it in the server.
So far, I got my app to run and work on my IDE which is JDev 9.0.3.2 (OLD) and Java version is 1.3.1_01, but when I try to compile to a jar file for some reason the lib doesn't come along.
My code (partially ofc):
Connection con = null;
public Depositos() throws Exception {
System.out.println("Beginning ORACLE DB connection");
try {
String connstr="jdbc:oracle:thin:"+"#<hostname>"+":"+"<port>"+":"+"<SID>";
System.out.println("connstr ok");
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Class.forName ok");
con = DriverManager.getConnection (connstr, "cic", "managercic");
System.out.println("Connection successful");
} catch (ClassNotFoundException e) {
throw new Exception("DB connection error "+e.getMessage());
}
}
And I suspect the problem is over here, more precisely in here:
"Class.forName("oracle.jdbc.driver.OracleDriver"); "
My procedure is:
On the Depositos.java folder
I run this:
javac -verbose Depositos.java -classpath C:\oracle\ora92\jdbc\lib\classes12.jar
the output says it's all OK.
jar cfmv0 Depositos.jar MANIFEST.MF Depositos.class C:\oracle\ora92\jdbc\lib\classes12.jar
my MANIFEST.MF contains:
Manifest-Version: 1.0
Created-By: Oracle JDeveloper 10.1.3.4.0
Main-Class: Depositos.Depositos
When I run the code from the src folder with:
java oic.OIC
my output is:
Beginning ORACLE DB connection
connstr ok
Exception in thread "main" java.lang.Exception: DB connection error oracle.jdbc.driver.OracleDriver
at Depositos.Depositos.<init>(Depositos.java:47)
at Depositos.Depositos.main(Depositos.java:98)
Which leads me to the conclusion that the error is in the line I stated above.
And I don't understand what I did wrong, I've read so many post from other forums, I don't know what's the right move anymore.
I tried several combinations of compiling commands.
Thank you for your help.
You can add the oracle jar to your jar, and put a 'Class-path' attribute in the manifest.
Manifest-Version: 1.0
Created-By: Oracle JDeveloper 10.1.3.4.0
Main-Class: Depositos.Depositos
Class-path: <path to jar inside your jar>
From memory though, if your jar is signed, you need to sign the jars within it also.