Sarada Akurathi
Sarada Akurathi

Reputation: 1188

How to simulate onblur event with Robot Framework

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

Upvotes: 2

Views: 3021

Answers (2)

Mika72
Mika72

Reputation: 411

Just to save few minutes of googling.

Simulate

is deprecated. Use

Simulate Event

instead

Upvotes: 0

greystoke
greystoke

Reputation: 46

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.

Upvotes: 3

Related Questions