can't Augment chrome (webdriver 2.35 upgrade to 2.39)

332 views
Skip to first unread message

BillR

unread,
Jan 7, 2014, 8:41:48 PM1/7/14
to webd...@googlegroups.com
Webdriver: 2.39.0
OS: older and newer Ubuntu 64-bit
Chrome: 26.0.1380.0, also  31.0.1650.63
Chromedriver: 23.0.1240.0. also v2.8.240825

I just bumped my webdriver version from 2.35.0 and get this on augment:

                    driver = new ChromeDriver();
                    driver = new Augmenter().augment(driver);

net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessException-->Class org.openqa.selenium.remote.Augmenter$CompoundHandler can not access a member of class org.openqa.selenium.chrome.ChromeDriver with modifiers "protected"
        at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
        at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
        at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:216)
        at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:643)
        at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:231)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
        at org.openqa.selenium.remote.Augmenter.performAugmentation(Augmenter.java:140)
        at org.openqa.selenium.remote.Augmenter.create(Augmenter.java:53)
        at org.openqa.selenium.remote.BaseAugmenter.augment(BaseAugmenter.java:114)
        at com.xoom.qa.helper.XoomSelenium.startSelenium(XoomSelenium.java:592)

Is this a bug? Latest chromedriver doesn't fix it.

Thanks,
Bill

darrell

unread,
Jan 8, 2014, 10:11:05 AM1/8/14
to webd...@googlegroups.com
I'm behind a firewall and it is little hard to pull down the repository for me but what I would do is clone the Selenium repository (git clone https://code.google.com/p/selenium/) then see what changed in java/org/openqa/selenium/remote/Augmenter.java between the tags 2.35 and 2.39. hopefully looking at the git history you'll be able to see what changed and it will help you figure out why it is no longer working for you. The change might also be in BaseAugmenter.java since it is inherited by Augmenter.java.

There is a chance you were doing something undocumented which worked but no longer works. So if you cannot figure it out by looking at the Augmenter code, maybe the rest of the setup for the ChromeDriver (from com.xoom.qa.helper.XoomSelenium.startSelenium) might help us. I.e. are you doing any DesiredCapabilities or some other modification of ChromeDriver. Also, just to go with a tested combination, I always update my ChromeDriver when I update my Selenium jars.

BillR

unread,
Jan 8, 2014, 3:54:27 PM1/8/14
to webd...@googlegroups.com
Thanks Darrell, that's the whole setup for Chromedriver. Possibly the change is that someone made a field in the ChromeDriver class protected, being unaware of its use by the Augmenter. The Augmenter sets the ability to take screenshots. Looking at source/history is the way to go..

Bill

BillR

unread,
Jan 8, 2014, 6:01:15 PM1/8/14
to webd...@googlegroups.com
With 12.36.0 and 12.37.0 I can do the augmentation, but on driver.get():

    Xlib:  extension "RANDR" missing on display ":99".
    Xlib:  extension "RANDR" missing on display ":99".
    org.openqa.selenium.WebDriverException: Unknown command 'WaitForAllTabsToStopLoading'.

    Driver info: org.openqa.selenium.chrome.ChromeDriver
    Capabilities [{platform=LINUX, chrome.chromedriverVersion=23.0.1240.0, acceptSslCerts=false, javascriptEnabled=true, browserName=chrome, rotatable=false, locationContextEnabled=false, version=31.0.1650.63, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, chrome.nativeEvents=false, applicationCacheEnabled=false, takesScreenshot=true}]
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	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:554)
    	at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:276)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.openqa.selenium.remote.Augmenter$CompoundHandler.intercept(Augmenter.java:280)
    	at org.openqa.selenium.chrome.ChromeDriver$$EnhancerByCGLIB$$31dd9395.get(<generated>)
    	at com.xoom.qa.helper.XoomSelenium.open(XoomSelenium.java:289)

BillR

unread,
Jan 8, 2014, 6:39:32 PM1/8/14
to webd...@googlegroups.com
It turns out that ChromeDriver will take screen shots without being augmented, so problem solved (using 2.39.0).

Thanks,
Bill

David

unread,
Jan 9, 2014, 2:40:15 PM1/9/14
to webd...@googlegroups.com
FYI, from what I recall researching this topic in general a short while back, the driver (at least on recent releases) only needed to be augmented when it was a RemoteWebDriver instance to be able to take screenshots. The native driver bindings didn't need to be, so looks like ChromeDriver follows that guideline too.

Was ChromeDriver required to be augmented at some point in the past? Wish the documentation for this stuff was made more explicitly clear...

BillR

unread,
Jan 10, 2014, 3:54:10 PM1/10/14
to webd...@googlegroups.com
I was augmenting ChromeDriver because I'm using the RC. It works with RC without augmentation.

Bill
Reply all
Reply to author
Forward
0 new messages