Thursday 3 October 2013

Retrieving the data using selenium

Retrieving data:

driver.findElement(By.id("id")).getAttribute("value");
Store the value in the string and retrieve it

You can also use 'getText()'

Retrieving Check box value:

driver.findElement(By.id("id1")).getAttribute("checked");
The outcome will be a Boolean value

Page title:

driver.getTitle();
Store the value in the string and retrieve it

Page source and URL:

driver.getPageSource();
driver.getCurrentUrl();

No comments:

Post a Comment

Angular JS Protractor Installation process - Tutorial Part 1

                     Protractor, formally known as E2E testing framework, is an open source functional automation framework designed spe...