Sunday, June 03, 2012

Watir Recorder - Open Source

For those in a hurry here is the download link: https://github.com/codecentrix/open-twebst/releases/

Open Twebst is an open source web automation library and web recorder for Internet Explorer browser. It is somehow similar in features with Watir. Because of that I decided that I could reuse Twebst web recorder to generate Ruby code for Watir.

Just choose Watir from the language combo-box, press start recorder and you're ready to go! The web recorder also generates VBScript, JScript, C#, VB.Net and Python code for Open Twebst Library.

Future plans: I've already started to work on a new web spy + code generator wizard that will support Watir too.

For any questions, remarks, bug-reports, ideas or anything else, feel free to post on Twebst Google Group and/or Twebst Linkedin Group.

Watir Web Recorder - Open Source
Open Twebst - Watir Recorder

22 comments:

토토이 said...

I'm sorry that I'm not good at English.

I have interest in your Project IE Automation Library and it helped me a lot.

I downloaded the source and knew that the file BrowserPlugin.h is missing.

How can I get BrowserPlugin.h file?

Can you send me the file via E-mail?
My E-mail address is totoy69@naver.com

Thank you & have a nice day :)

Adrian Dorache said...

Hi,

I guess BrowserPlugin.h is generated from BrowserPlugin.idl

Adrian.

토토이 said...

Thank you very much~ :)

Hazır Tasarımlar said...

hi,
can i simulate google search for my keyword and click my website as a record and play again.

regards

Adrian Dorache said...

Hi Hazir,

Yes the scenario you have described can be done with Open Twebst

Regards,
Adrian.

Hazır Tasarımlar said...

Dear Adrian,could you please send me a sample c# code.i can make search with your programe and also i can click the other pages but no luck finding and clicking the href link which i need.

B.Regards
Arda

토토이 said...
This comment has been removed by the author.
토토이 said...
This comment has been removed by the author.
토토이 said...

Hi,

I can't compile opentwebst in MFC diloag based project
It compiled well in empty project vc++

but in mfc project, i put the source like below as like your sample in my source code

---------------------------
#include iostream
#include tchar.h
#include atlbase.h
#include Exdisp.h
#include Mshtml.h

#import "progid:OpenTwebst.Core"
-------------------------------------

it output complile error message as like missing type defintion
I think there are problem between OpenTwebstLib.tlh and mshtml.h in type defintion.

how can i compile it?

is it any setting value in my mfc project?

please help me~

Best Regards~

Adrian Dorache said...

Never tried with MFC projects. Try to import the COM library using MFC class wizard which will generate wrapper classes.

토토이 said...

Yes

I imported the COM library using MFC class wizard so it make CCore.h, CBrowser.h ....

but same problem has occured

class wizard makes "#import" code line in top of each header file like below

----------
#import "C:\\Program Files\\Codecentrix\\OpenTwebst\\Bin\\OpenTwebstLib.dll" no_namespace
----------

and I included the header file in my source (ex. #include "CCore.h" in TestOpenTwebstDlg.cpp")

compile output is

1>d:\workspace_vs\testopentwebst\testopentwebst\debug\opentwebstlib.tlh(391): error C2146: syntax error : missing ';' before identifier 'nativeElement'
1>d:\workspace_vs\testopentwebst\testopentwebst\debug\opentwebstlib.tlh(391): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\workspace_vs\testopentwebst\testopentwebst\debug\opentwebstlib.tlh(391): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\workspace_vs\testopentwebst\testopentwebst\debug\opentwebstlib.tlh(456): error C2146: syntax error : missing ';' before identifier 'GetnativeElement'
1>d:\workspace_vs\testopentwebst\testopentwebst\debug\opentwebstlib.tlh(456): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

I think that compiler doesn't know the type like IHTMLElementPrt, IElementPtr, IBrowserPtr etc.

Is there any way solving my compile problem?

Have a good day~ :-)

토토이 said...
This comment has been removed by the author.
토토이 said...

hi~

i solved the problem

i inserted one line in stdafx.h

#import "mshtml.tlb"

that's all :-)

thank you very much

and have a good day~

Adrian Dorache said...

Thanks for sharing the solution!

Adrian.

Hazır Tasarımlar said...

hi,
i can click the link in the first page like this
browser.FindElement("a", "uiname=" + titleTextBox.Text).Click();

but i dont know how to check with if this link in the second page.
i tried browser.FindElement("a", "uiname=2").Click();
how can i make a if logic to check.
regards

Adrian Dorache said...

To decide what is the current page on google search page you could try to

FindElement("td", "class=cur");

this is actually at the bottom of the page 1, 2, 3 ...

cur is the current page and you simply get the text of the found TD.

Adrian.

Hazır Tasarımlar said...

Dear Adrian,
thank you for your kind attention.
actually i am tying to find my page in google search, with each page i will check if is my link is there and when it finds it will click automatically.
my code is something like this:

ICore core = new Core();
core.useHardwareInputEvents = true;
IBrowser browser = core.StartBrowser("www.google.com.tr/search?q=" + keywordTextBox.Text);
System.Threading.Thread.Sleep(10000);

try

if // check if titleTextBox.Text is here than
{
browser.FindElement("a", "uiname=" + titleTextBox.Text).Click();
}
else //check the other pages
{

}

catch


regards

Hazır Tasarımlar said...

hi,
this sample how will work,when i click button it opens another browser instance.i am using c#.

ICore coreObj = new Core();

var b = coreObj.foregroundBrowser;

if (b == null)
{
// No foreground browser.

b = coreObj.StartBrowser("http://www.codecentrix.com/");
}
else
{
b.Navigate("http://www.codecentrix.com/");
}


regards

노예몰 said...

hi

I am using your Open Tweblib in vc++ vs2010

it works very well in stand alone IE8,9

but in Webbrowser Control like MSWebbrowser ActiveX
it did't work function - FindElement and FindAllElements (i'm only tested this function)

do you have any solution this problem?
is it works in Twebst pro?

sorry for my english ^^

thank you

Adrian Dorache said...

If you want to automate WebBrowser control embedded in other applications then it should work.

See APP attribute in FindBrowser: http://doc.codecentrix.com/LnkFindBrowser.htm

If you want to automate WebBrowser control from your own application then it won't work in Open Twebst (or at least not as easy like in Pro).

Patel Alok said...

HELLO EVERY ONE,
I HAVE RECORDED IE MACRO USING TWEBST AUTOMATION STUDIO.
NOW CAN I USE THAT MACRO DIRECTLY BY EXCEL.? (BUT I WANT TO OPEN IE DIRECTLY , MEANS WITHOUT TWEBST.CORE)

IN SHORT CAN I USE THAT MACRO WITHOUT INSTALLING TWEBST AUTOMATION STUDIO??

Anoop For You said...

I have a issue with this library. I used it with c++ and put 100 urls to navigate and it stopped in 23rd one as that url was not exist and that is
http://merchant.myshopping.com/

so all other urls were failed in navigation. all were going to catch block though browser pointer was not null. it had memory.


don't feel its trustworthy library.