Monday, October 19, 2009

Silk4Com

Silk4com is a COM interface for open agent. Still it is under development. It is an open source project and hosted on google code pages. I would say, it is an innovative idea.

URL: Silk4Com Project page

Summary from Project page
"This project is an add-on for SilkTest 2009. The goal of this project is to provide a COM interface for the Open Agent, which can be used by many different scripting languages to drive the Open Agent. With silk4com you can use most of the JTF API in VBScript, JavaScript or even in VBA, without the need of a Java Compiler and JUnit. "

I tried a sample script and it works fine.
VBS Code with Silk4Com

Sub SimpleTestcase2(browser) Set searchField = browser.Find("//input[@name='q']") searchField.hugo = "asd" WScript.Echo(searchField.hugo) '' Added by Palani searchField.setText("silk4j tutorial") Set btn = browser.find(".//input[@type='submit' and @name='btnG']") 'Set btn = browser.find(".//DomButton[@type='submit' and @name='btnG']") ''Not working btn.click() End Sub
Silk4j Code
@Test public void testSimpleGoogleSearch() throws Exception { // DomTextField[@title='Google Search' and @maxLength='2048' and @size='55' and @name='q' and @autocomplete='off'] DomTextField searchText = (DomTextField)browser.find (".//DomTextField[@title='Google Search' and @name='q']"); searchText.setText(""); searchText.setText("silk4j tutorial"); DomButton btn = (DomButton)browser.find( ".//DomButton[@type='submit' and @name='btnG']"); btn.click(); }

1 comment:

Webplore said...

Well done got some nice information, keep going...