2
votes

I am automating login scenario of an application.

The execution steps are as below:

  1. Select the Country

  2. Enter the Username

  3. Enter the Password

  4. Click on Login Button.

Actually after entered the username, application validates the country and username in database exists or not.

When tried to automate through robot framework, this validation is not called and so unable to login (actually login button is clicked through script, but no error message or no response user is in same page).

When i verified exact scenario it calling the validation, comes to know that validation is called on onblur of the usename element onblur="getlocation()".

I tried to simulate this by give tabout from username field through script as Press Key ${element path} \\9 but it is not working always out of 10 run only 3 or 4 times it working.

Is there any way we can do 'blur` action on the element in robot framework

2
Not really answering your question, but have you tried to focus the onblur element? Using Mouse Over, for example.Helio
I didn't try using mouse over but I tried focus to element , enter the value and then tab out from elementSarada Akurathi
I tried to use mouse over, i got webdriver exception. when i googled it, i got the information that the issue exist with firefox marrionette for Mouse events, please check issue linkSarada Akurathi
Have you tried to click another (possibly dummy/hidden) element on page?Jan Kovařík
click element is working but not double click element or mouse over and other mouse elements. I tried with other elements alsoSarada Akurathi

2 Answers

3
votes

In the Selenium2Library for robot, there is a special keyword for that:

Simulate  <element>  <event>

In my keyword definition it looks like this:

I Enter The New Password
  [Arguments]   ${text}
  Input Text   ${INPUT_ELEMENT_PASSWORD}   ${text}
  Simulate  ${INPUT_ELEMENT_PASSWORD}  blur

http://robotframework.org/Selenium2Library/Selenium2Library.html#Simulate

I hope that helps, it took us a while to figure out what was missing in the test.

0
votes

Just to save few minutes of googling.

Simulate

is deprecated. Use

Simulate Event

instead