Hi!
I've one PHP method that runs a jQuery function and works 100%
function getTopProduct()
{
$top_product_id = $this->getEval('var window = this.browserbot.getUserWindow();
window.$(".parent:first").attr("ID")');
return $top_product_id;
}
but now, i wanna make another function that execute other jQuery script, but in that script i had to create a new jQuery function.
I tried many ways to execute that scripts with no success...
So, i would like to know if anyone have any idea how to run jQuery scripts that have new jQuery functions.
I am desesperated, because is an essencial module of my selenium tests.
This is the function i wanna implement.
function getRequisitionNumber()
{
// Number of products in requisition after delete
$requisition_number = $this->getEval('var window = this.browserbot.getUserWindow();
window.get_max_order_id();
function get_max_order_id()
{
var A_childs_tr = $(".requisitionstable tr.child");
var max_order_id = - 1;
A_childs_tr.each(function(index, order_tr)
{
var order_id = $(this).attr("ID").split("_");
if ( order_id[1] > max_order_id )
max_order_id = order_id[1];
});
return max_order_id;
}
');
}