Monday, 5 May 2014

Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function

While running java class file for selenium webdriver facing with the issue as below:

Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Command duration or timeout: 30 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15'
System info: host: 'rgfr12321', ip: '104.43.244.18', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45'
Session ID: 7afc8ea4-c911-4da7-a435-5f34622ca096
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true, nativeEvents=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=28.0}]
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
 at java.lang.reflect.Constructor.newInstance(Unknown Source)
 at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
 at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
 at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
 at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:300)
 at sample.Gmail.main(Gmail.java:14)
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: f.QueryInterface is not a function
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15'
System info: host: 'rgfr12321', ip: '104.43.244.18', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45'
Driver info: driver.version: unknown


This can be corrected by having the pull path of the url as below


Change:
WebDriver driver = new FirefoxDriver();
driver.get("www.gmail.com");

To:
WebDriver driver = new FirefoxDriver();
driver.get("http://www.gmail.com");

Wednesday, 9 April 2014

Installing Jenkins in Unix/windows machine

1. Download jenkins.war file from http://jenkins-ci.org/ and upload it to the server

2. Execute the java web archive (Jenkins.war file) by running command

java –jar jenkins.war


3. The Jenkins server page can be viewed in browser on http://<server_ip>:<port_no>/



     After the server page is loaded


4. Now the Jenkins server is up and running. The new jobs and new nodes on which the jobs are designed to run should be set up.

Saturday, 29 March 2014

Insert string with apostrophe(') in sql

when using Insert statement to inset string type fields and the values has an apostrophe('), how

the inset statements can be handled in such cases.


SQL> insert into donuts values('jelly's,9);
insert into donuts values('jelly's,9)
                                   *
ERROR at line 1:
ORA-00917: missing comma


SQL> insert into donuts values('jelly''s,9);
ERROR:
ORA-01756: quoted string not properly terminated

The Error displayed here is due to string data types that are delimited by the single quotation mark and the apostrophe(') is considered as the end of the string  delimiter.

The possible way is to escape single apostrophe (') with an extra apostrophe as below.


SQL> insert into donuts values('jelly''s',9);

1 row created.

Now the string with apostrophe is inserted into the table.

SQL> select * from donuts;


NAME PRICE
---------- ----------
jelly 9
jell's 9


Monday, 24 March 2014

count tables for each user in oracle database

sql query to count no of tables owned by each user in oracle database


SELECT COUNT(*), owner  FROM ALL_TABLES group by owner;


SQL> SELECT COUNT(*), owner  FROM ALL_TABLES group by owner;
  COUNT(*) OWNER
---------- ------------------------------
        39 WIN
        39 REDON
      121 PANK
    3456 ANA
        32 MONK
        72 PAT
        93 GREF
    3456 CHIN
        10 KILM
        20 BLOG
      155 SYSTEM
   
11 rows selected.