selenium-google-code-issue-archive
selenium-google-code-issue-archive copied to clipboard
Selenium IDE missing JavaScript format
Originally reported on Google Code with ID 7599
I looked around but I don't see a way to export Selenium IDE scripts to JavaScript,
specifically for selenium-webdriver on npmjs.org https://www.npmjs.org/package/selenium-webdriver
Are there any directions on writing a formatter / exporter? I've looked at the ones
that come with Selenium IDE but without documentation, it's not clear enough to me
what I have to do.
Reported by matthewkastor
on 2014-07-12 04:57:44
Yes, undocumented, unfortunately.
Reported by barancev
on 2014-07-12 12:05:51
- Labels added: Type-Enhancement, Component-IDE, GettingInvolved
- Labels removed: Type-Defect
Here's a start at it. I modified the "Java / JUnit 4 / WebDriver" formatter and sort
of have something working.
There are a few pieces of the script that I have no clue what they're for.
1) function useSeparateEqualsForArray
2) function joinExpression
3) how I'm supposed to implement things like "waitForElementPresent" when "By" throws
errors that get past a try catch block...
4) I didn't even try tackling "pause" yet, but I need it.
5) WDAPI.Element.prototype.select I don't know what this is doing.
To try it out, add the JsFormatter and export your tests and suite. The test cases
won't run by themselves. I've set it up to use one browser window per suite. You'll
need the selenium-ide.js file alongside your test cases. These are functions that are
usually copied into every test case but that bothered me so I just require it instead
and call it's methods a little differently.
Uncomment the last line in the test suite and run it through node.
Reported by matthewkastor
on 2014-07-13 23:30:57
- _Attachment: [JsFormatter.js](https://storage.googleapis.com/google-code-attachments/selenium/issue-7599/comment-3/JsFormatter.js)_ - _Attachment: [selenium-ide.js](https://storage.googleapis.com/google-code-attachments/selenium/issue-7599/comment-3/selenium-ide.js)_
Have you made any more progress on this? I too am looking for a JavaScript formatter.
Reported by wasmithee
on 2014-12-08 17:06:10
I haven't done any more work on this at all. I was running into trouble
with the differences between the RC and Webdriver functionality. My scripts
rely on Dom selectors, to send keys to Angularjs searchable selection
controls. I couldn't figure out how to send keys to elements that take
focus, when they're generated on the fly and have no properties that are
identifiable between tests. So I gave up.
dom=document.activeElement
I really wish I could just use the IDE to run tests against a remote
Selenium RC server so I wouldn't have to deal with translating things. All
I'd have to do then is implement the selblocks global extension as a server
extension and be done, and be able to run the tests against the various
browsers I want.
Reported by matthewkastor
on 2014-12-08 22:35:56
Reported by luke.semerau
on 2015-09-17 17:47:03
- Labels added: Restrict-AddIssueComment-Commit