Skip to content

needed a Get Weblement(s) keyword #315

@KD1102

Description

@KD1102

Hello,

I was working on a test for selecting a date from datePicker. By mentioning simply the xpath of the webelement from the calendar, but to requirement is to select (Now+2d) add 2 days to the current day.
Right now, i have to hard code the table cells (tr and td) to select the date.
But to create a dyanmic xpath, i need to work on webelements, which is missing right in current version of Selenium2Library. For example, code implemented in Java- Webdriver,

/*DatePicker is a table.So navigate to each cell
* If a particular cell matches value 13 then select it
*/
WebElement dateWidget = driver.findElement(By.xpath("//table[@Class='ui-datepicker-calendar']"));
List columns=dateWidget.findElements(By.tagName("td"));

    for (WebElement cell: columns){  
        //Select 13th Date   
        if (cell.getText().equals("13")){  
            cell.findElement(By.linkText("13")).click();  
            break;  
        }  
    }  

I want to re-do this code in Robotframework.

Kindly help.

Regard,
Kuldeep

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions