Imagine that you wanted to work with Google Chrome to get an attribute of an element on the page. To do this we will need to instantiate a ChromeDriver. Let's see an example.
Update the setUp() method to load the ChromeDriver() :
driver = new ChromeDriver();
Now we need to find an element.In this section we will find the one with
the ID s electLoad:
WebElement element = driver.findElement(By.id("selectLoad"));
Now we need to get the value attribute of that element:
Run your test and it should look like the following:
What just happened?
We have just run a test with Google Chrome or with Chromium. It was fairly simple to get going and then the browser was able to get the value of the button. If you had trouble getting it to run, make sure that you have downloaded the ChromeDriver and added it to the environment variable called PATH.
Now that we have got ChromeDriver working, let's have a look at how we can update the browser as we did with Firefox.
Google Chrome or Chromium doesn't really have a profile that users can update in the same sense as Firefox.It does however have a mechanism that allows us to set certain options that Chrome will try and use. We can also tell it to install Chromium extensions, which are like Firefox add-ons, into the browser so we can enhance the experience.
Selenium Related Interview Questions
|SILK TEST Interview Questions||QTP Interview Questions|
|JMeter Interview Questions||Automation Testing Interview Questions|
|Software testing Interview Questions||JUnit Interview Questions|
|TestNG Interview Questions||SAP Testing Interview Questions|
|Selenium WebDriver Interview Questions||Selenium IDE Interview Questions|
|QUnit Testing Interview Questions||Performance Testing Interview Questions|
|Hadoop Testing Interview Questions|
Getting Started With Selenium Ide
Overview Of Selenium Webdriver
Working With Webdriver
Getting Started With Selenium Grid
Advanced User Interactions
Working With Html5
Migrating From Remote Control To Webdriver
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.