kalyani waghmare
kalyani waghmare

Reputation: 3

How do i get text from a element when the argument is passed

I am writing a keyword which would return two time format available(time1 and time 2) from a alert box.Now when i call the keyword in test case i will pass only one argument i.e.time 1 it should return only the text of time1

[Arguments]  ${filename} ${uploadtime}=SKIP  ${updatetime}=SKIP

Selenium2Library.Wait Until Element is Visible       xpath=.//*[contains(text(),'${filename}')]
Selenium2Library.Wait Until Element is Visible       ${opt}
Selenium2Library.wait until element is visible       ${opt1}
Selenium2Library.Click Element                       ${opt1}
${uploadt}=  Get Text                                ${upload_time}
Run Keyword If    '${uploadtime}' != 'SKIP'      [Return]      ${uploadt}
${updatet}=  Get Text                                ${upload_time}
Run Keyword If    '${updatetime}' != 'SKIP'     [Return]      ${updatet}

Invalid argument specification: Invalid argument syntax '${filename} ${uploadtime}'.

Upvotes: 0

Views: 192

Answers (1)

Todor Minakov
Todor Minakov

Reputation: 20077

There's a syntax error in the arguments declaration - only one space between ${filename} and ${uploadtime}, which is what the error message says.

Put at least 2 (the more - the better readability) to signal these are 2 separate arguments.

Upvotes: 2

Related Questions