1

I am testing a web app where a file is to be renamed as follows 1)first click on the files name 2) this will make a textbox appear 3) I type the new name in textbox 4) I have to click outside the textbox so that the new name gets set. or 4) Press enter key

The problem is in step 4. I've tried to get it to click at several places in my app, but the textbox doesn't loose focus and hence the name doesn't get set. I've even tried to use focus command, but, in vain.

Also tried to do this with enter key, but, seems that it doesn't work too. I tried keypress, keypressnative, etc. nothing seems to work.

Note: this sequence works when I do it manually and doesn't work when I do it from IDE or RC for C#.

Any help in this direction??

Thanks, Vamyip

2 Answers 2

2

Selenium does not always fire the proper events. Probably your application relys on the blur event of the text box?

Try

selenium.fireEvent(locator_for_textbox, "blur");
1
  • Thanks for taking time to reply. It worked exactly the way I wanted. Thanks again, Vamyip
    – vamyip
    Jul 5, 2010 at 5:42
0

Capybara throws an error because the driver does not support 'blur' So I use:

find('html').click

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.