Test hostScripts with smileycookie

I hope I am in right places.

Recently I want to test similecookie performance. The test procedure is:
Go to http://www.smileycookie.com
Select from menu “Shop By Price”
Select menu item “$20.00 -$30.00”;
Select Position dropdown and select Sort Product by “Sales Rank”;
Click the first item on the page;
Enter QTY to “3”
Click “ADD TO BASKET”
Click “PROCEED TO CHECKOUT”

=================
I wrote scripts like:
logData 1
navigate http://www.smileycookie.com/

click innerText=“$20.00 -$30.00”
//navigate http://www.smileycookie.com/shop-by-pric...hirty.html

navigate http://www.smileycookie.com/shop-by-pric...sales_rank

navigate http://www.smileycookie.com/travel-mug-c...asket.html
//click title=“Travel Mug and Gourmet Sugar Cookie Gift Basket”
//click innerText=“Travel Mug and Gourmet Sugar Cookie Gift Basket”
//clickAndWait id=“name1”

//Enter QTY to “3”
setValue id=qty 3
//Click “ADD TO BASKET”
click className=“button add-to-cart”

//Click “PROCEED TO CHECKOUT”
clickAndWait title=“Proceed to Checkout”

The issue:
a) The homepage popups a dialog and block next click event.
b) Though popup is closed manually, the next click and clickAndWait with title/className/innerText seems still not work.
The test browser is FF.
Could anyone help me resolve this issues(a and b). Or correct me if any wrong in my scripts. Thanks

You can either use javascript or a click event to close the dialog. Using javascript with the exec and execAndWait commands is probably the easiest way to do it because you can debug your javascript locally using the firefox console and make sure the commands work before submitting a test script.

Is 3rd party Javascripts supported? If not, how can I simulate click event on DOM element?

In the sample:
navigate http://www.smileycookie.com/travel-mug-cookie-gift-basket.html
//click className=“button add-to-cart”
execAndWait jQuery(‘input[class~=“add-to-cart”]’).trigger(‘click’) //NEW
The corresponding DOM element is:

I first tested “jQuery(‘input[class~=“add-to-cart”]’).trigger(‘click’)” in Firefox console and it works, but exec(or execAndWait) jQuery(‘input[class~=“add-to-cart”]’).trigger(‘click’) does not trigger click event when it is tested with WPT.
My question is whether jquery or other 3rd JS APIs is supported for exec invocation?
Thanks

If jQuery is loaded by the page then it should be available (though you may want a semicolon at the end of the command). The exec commands literally just execute the given javascript in the context of the page. I’ll take a look in a bit with a private agent and see if I can see what the script is doing.