Been doing some record play back with selenium and wanted to capture a few handy commands for storing variables, and making elements lose focus.
Storing a variable
This will store a random number in the variable invoicenumber.
You can then access the variable to type into a textbox by doing this
Or use it later in a selector to double click something by doing this
Lose focus with the blur command
Sometimes in selenium popups and dialogs don’t close the way they should when you are clicking through the application with a mouse.
If this has happened to you, try entering a key press on another field with the value ‘\9’ and then firing the ‘blur’ event.
This helped me close a pesky calendar pop-up that wouldn’t go away and prevented me from submitting a form.
Check if a button is disabled
Update: To select text within a span use the following xpath (requires jQuery):
//span[text()=’${invoicenumber}’]
td > span:contains(“71378”)
Aug 07, 2013 @ 06:48:29
thanks, blur also worked for removing focus from a field
Feb 25, 2017 @ 02:53:23
Nice to know about the selenese commands that will help the people to learn about the basic selenium IDE. then they can develop their knowledge in web driver.
Oct 05, 2017 @ 07:43:26
Thank uh its working for me for focus on disable button