The question is from Theyagarajan, I post it here so that more people
can get involved in the discussion,

"Iam trying to give a pause for every click/submit for the reason that
i dont want to be adding pause at every click that i make instead call
a fn which will put its pause.How do i connect to current selenium
instance and execute command from a different class?

or is there a way i can override click,submit to have a pause after
action is performed ?"

Actually, I thought of this long time ago, but did not implement it in
Tellurium. The reason is the web response
time is really difficult to predict. Long pause time will slow down
the testing and short pause time may not be
sufficient. That is why waitForPageLoad or other commands are more
appropriate than pause. But what if you
have ajax application or you do not have page load?

However, if you really want to implement that, you can either write
your own Java/Groovy code to
use method interceptor so that for all the actions, you put a pause
after the actions.

Or you can change the Tellurium core code to do that. More
specifically, in the processEvents method in the  EventHandler class,

    protected void processEvents(String locator, String[] events,
String[] defaultEvents, Closure action){
        checkElement(locator)
        if(dispatcher.isElementPresent(locator)){
            Event[] evns = alg.sort(events, defaultEvents)
            evns.each { Event event ->
                if(event == Event.ACTION)
                  action()
                else
                  processingEvent(locator, event)
            }

        }
    }

You can add a pause command right after the "action()" line.

Thanks,

Jian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to