Page 1 of 1

revBrowser - Focus

Posted: Thu Mar 11, 2010 12:34 pm
by dickey
Hello All,

How do I change focus to a revBrowser instance (id say 54)?

There are focus commands in the depreciated XBrowser library: XBrowser_Focus / XBrowser_Unfocus, but none to my knowledge in the revBrowser library.

Interestingly, the revBrowser object when invoked does not list in the Application Browser.

Without a revBrowser library function for focus/unfocus I am not sure how to use rev code (statements such as click and type) to interact with the revBrowser.

The revBroswer library will allow a developer to interact with a webpage (automate tasks) by executing javascript (revBrowserExecuteScript), however I was hoping to use both methods for automating browser tasks: Method 1: direct rev code to click and type for flash, and silverlight sites, and Method 2: using JS calls to automate regular sites where you can from the source identify object ids.

Any assistance greatly appreciated.

Kind regards, Andrew

Re: revBrowser - Focus

Posted: Thu Mar 11, 2010 2:54 pm
by Mark
Hi Andrew,

You seem to be confused about the fact that the browser window is not a native object. It is a separate window that's layed over the stack window and you can interact with it only by means of revBrowser commands and direct user input.

Best,

Mark

Re: revBrowser - Focus

Posted: Fri Mar 12, 2010 3:11 am
by dickey
Thank you for your reply Mark,

Whilst I may sound confused I am just puzzled at the seeming gap in functionality between the old and new browser libriaries.

I already understood from experimentation that the browser window was not a native Rev object. The experiment: I placed a button beneath the location of the rect of the revBrowser and then using click at x,y to determine whether it would click within the revBrowser or the stack window behind it. The click actioned the button of the stack window (behind) and not the browser window. I was hoping the opposite would have been the case. This supports your advice Mark. That then led me to think it was a question of focus. If I could first push focus to the revBrowser or XBrowser window, might then I be able script what is termed 'direct screen' actions (click at x,y etc), to automate sites where automation via javascript is inappropriate.

I experimented with the legacy XBrowser library, specifically XBroswer_Focus, but that does not work either.

It would have been very powerful, to have the ability to focus on the revBrowser object and use non revBrowser library code to interact with the page (such as click and type).

Does anyone know why this functionality was lost? and whether revBrowser will be extended to include it again at some point?

Mark, again thanks for your interest.

Kind regards, Andrew

Re: revBrowser - Focus

Posted: Fri Mar 12, 2010 9:34 am
by Mark
Hi Andrew,

I am not even sure whether the XBrowser_Focus command actually brought a particular browser instance to front. I think it just set the focus. Setting focus without bringing the browser instance to front might have caused problems.

Usually, I just show and hide browsers. I show the next browser, set it's rect to that of the previous one and then hide the previous one.

Best regards,

Mark