Back To Normal

Subscribe To Our E-Mail Newsletter

Wednesday, December 14, 2011

How to connect Webdriver with IE explorer?

Below code will be usefull for you to connect IE with Webdriver.

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();

capabilities.set(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true);

WebDriver driver = new InternetExplorerDriver(capabilities);


driver.get(sURL);
Read More


How to Integrate Selenium webdriver with eclipse?

1. Create Project in eclipse.


2. Right click the project and select Build Path --> Configure Build Path..

3. Import or Add all external jars to the Libraries .

     1. Add selenium standalone web driver jars

     2. Add Junit jars also..
4. Right click source (src) and create your own pacakges (TestSuite, utilities,Testcases..)

5. Start to write your own testcases in Java..
 public class TestacseName extends Testcase

{

               @setup
               @test
              @teardown

}
6.Run your tetsecase as ..

            1. Right click on Editer and select Run as Junit..

7. It will excuete java code on Browser.
Read More


How to read HtmlTable data by using Selenium Webdriver ?

public void ReadTableData(String sTableID)
{
WebElement table = driver.findElement(By.id(sTableID)));
// Now get all the TR elements from the table

List allRows = table.findElements(By.tagName("tr"));
// And iterate over them, getting the cells

for (WebElement row : allRows) {
List cells = row.findElements(By.tagName("td"));
for (WebElement cell : cells) {
Object CellValue = cell.getText();
System.out.Println("Cellvalue" +Cellvalue.toString )
}
}

}


Read More


560 Free Online Courses

Top 200 universities launched 500 free online courses.  Please find the list here .