Current time: 09-23-2020, 04:53 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Test hostScripts with smileycookie
04-16-2013, 06:11 PM (This post was last modified: 04-16-2013 06:17 PM by wodaxia.)
Post: #3
RE: Test hostScripts with smileycookie
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-c...asket.html
//click className="button add-to-cart"
execAndWait jQuery('input[class~="add-to-cart"]').trigger('click') //NEW
The corresponding DOM element is:
<input class="button add-to-cart" type="image" src="https://s3.amazonaws.com/clientinstalls/add-to-basket-orange-btn.png" style="clear: both; position: relative; left: 10px;">

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





(04-16-2013 03:38 AM)pmeenan Wrote:  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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Test hostScripts with smileycookie - wodaxia - 04-16-2013 06:11 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)