Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Allow Selenium IDE extensions to carry out custom commands using a callback function #442

Closed
lukeis opened this issue Mar 2, 2016 · 5 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 442

This patch creates a commandType 'util' which can be linked to a function 
to be executed when the command is selected from the right-click menu.

Extensions can use the following command to register this execute callback 
function.

CommandBuilders.add('util', MyExtension.prepareCommand, 
MyExtension.executeCommand);

MyExtension.executeCommand will be called when the user selects the 
command. The execute function can also return an array containing zero or 
more commands to be added to the current test case.

As an example, I have included an extension containing two commands 
(tableUtilCommandBuilders.js). One generates verifyTable commands for the 
row clicked on and the other that generates verifyTable commands for the 
entire table.

Let me know what you think.

Reported by Samit.Badle on 2010-03-31 16:09:17


- _Attachment: [UtilCommands.diff](https://storage.googleapis.com/google-code-attachments/selenium/issue-442/comment-0/UtilCommands.diff)_ - _Attachment: [tableUtilCommandBuilders.js](https://storage.googleapis.com/google-code-attachments/selenium/issue-442/comment-0/tableUtilCommandBuilders.js)_
@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by jmleyba on 2010-04-11 18:24:25

  • Labels added: Type-Enhancement, ide
  • Labels removed: Type-Defect

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

The implementation looks very good, beautiful code, and the sample is easy to follow.
I logged an issue #1073 which request exactly same feature. And after Samit point me
to this patch, I was able to use this enhancement with local changes, and it works
great!

To test this, I deployed the overlay and command builder changes into local IDE source
folder, along with sample implementation, I was was able to see it in action. I tried
both verifyTable and verifyRow, and they all looks good. I'm not sure what
other testing are required, but from what I can tell the patch works fine. Since
the executeCommand support empty, single, or multiple commands, I think it is more
powerful than just support one command execution.

In addition, I leveraged this patch to handle issue #1073 I initially reported. The
end result is excellent! I was able to tie-in my customer command and execution action
with 5 minutes work :)

Please promote this patch to IDE for future release, it will be very useful for other
users if they happen run into similar situations.

Thank you!

Chris

Reported by chrissu.a on 2010-12-03 15:37:21

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Moving to Started, as there is a patch attached.

Reported by antlong on 2011-01-24 18:24:42

  • Status changed: Started
  • Labels added: Component-IDE
  • Labels removed: ide

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Fixed in r11253. Should be available in Selenium IDE v1.0.11.

- Samit

Reported by Samit.Badle on 2011-02-02 14:44:30

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 17:48:58

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant