deprecation warning on using DesiredCapabilities for chrome browser.-Very urgent

184 views
Skip to first unread message

santosh h s

unread,
Apr 12, 2012, 2:27:16 AM4/12/12
to seleniu...@googlegroups.com
I am using below lines of code to initiate chrome browser, but deprecation warning... so please let me know workaround for this.

if (props.getProperty("browser").trim().toLowerCase().equals("gc") && (System.getProperty("os.name").toLowerCase().contains("windows"))){
            System.setProperty("webdriver.chrome.driver", props.getProperty("ChromeDriverPath").trim());
            DesiredCapabilities capabilities = DesiredCapabilities.chrome();
            capabilities.setCapability("chrome.switches", Arrays.asList(props.getProperty("chromeDefault_ProfilePath").trim()));
            driver = new ChromeDriver(capabilities);   



--

/Santosh

Mehul Mehta

unread,
Apr 12, 2012, 7:38:49 AM4/12/12
to seleniu...@googlegroups.com
Hi Santosh,
 
Please refer http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/chrome/ChromeDriver.html for instantiating the ChromeDriver for testing purpose.
 
-Mehul

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

santosh h s

unread,
May 1, 2012, 11:56:54 AM5/1/12
to seleniu...@googlegroups.com
Still on refering the document i am not getting the ways to launch google chrome with default profile on wondows

bellow is the code which i am currently using

if (props.getProperty("browser").trim().toLowerCase().equals("gc") && (System.getProperty("os.name").toLowerCase().contains("windows"))){
            System.setProperty("webdriver.chrome.driver", props.getProperty("ChromeDriverPath").trim());
            DesiredCapabilities capabilities = DesiredCapabilities.chrome();
            capabilities.setCapability("chrome.switches", Arrays.asList(props.getProperty("chromeDefault_ProfilePath").trim()));
            driver = new ChromeDriver(capabilities);   


/santosh
--

/Santosh

Jim Evans

unread,
May 1, 2012, 12:18:15 PM5/1/12
to seleniu...@googlegroups.com
The deprecation warning is to encourage you to use the ChromeOptions class instead of directly using DesiredCapabilities. I invite you to look over the JavaDoc for ChromeOptions to see if that's any clearer.

--Jim

Shaba K

unread,
May 1, 2012, 5:30:46 PM5/1/12
to seleniu...@googlegroups.com
Hey there ,

Just download the exe.

& refer the path in

WebDriver driver = new ChromeDriver("c:\chromedriver\");   //just teh dircetory where you have the exe

Will do all the magic

Cheers,
S

On Tue, May 1, 2012 at 5:18 PM, Jim Evans <james.h....@gmail.com> wrote:
The deprecation warning is to encourage you to use the ChromeOptions class instead of directly using DesiredCapabilities. I invite you to look over the JavaDoc for ChromeOptions to see if that's any clearer.

--Jim
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/aTE8GdyEm8MJ.

santosh h s

unread,
May 2, 2012, 1:49:11 PM5/2/12
to seleniu...@googlegroups.com
Problem is not in specifying the chrome driver path it is in launching the chrome in default profile by specifying the profile path

/Santosh
--

/Santosh
Reply all
Reply to author
Forward
0 new messages