The following script will perform a login on the myanonamouse.net website and spend all the bonus points to buy upload credit. The script will have to be modified by loading the script in Selenium IDE and then changing the EMAIL
and PASSWORD
values to the values of the account that the script will be used with.
{ "id": "cf0cd635-7b96-4a36-b044-97b7489c225a", "version": "2.0", "name": "MAM Spend Bonus", "url": "https://www.myanonamouse.net", "tests": [{ "id": "01add63d-5230-4e52-ac6c-b5ab486fac17", "name": "Spend Bonus", "commands": [{ "id": "a875756a-ce37-47c5-acfe-3558eba1de66", "comment": "", "command": "open", "target": "/login.php", "targets": [], "value": "" }, { "id": "23be16ba-30d0-463a-bb32-dc801efb53ff", "comment": "", "command": "setWindowSize", "target": "800x600", "targets": [], "value": "" }, { "id": "6773da0f-17df-46d5-9210-ed20ef56b39a", "comment": "", "command": "waitForElementEditable", "target": "name=email", "targets": [], "value": "30000" }, { "id": "d3efbdf9-eddd-474e-92bb-6c8f0fa68681", "comment": "", "command": "type", "target": "name=email", "targets": [ ["name=email", "name"], ["css=tr:nth-child(1) > .row1 > input", "css:finder"], ["xpath=//input[@name='email']", "xpath:attributes"], ["xpath=//div[@id='mainBody']/form/div/div[2]/div/table/tbody/tr/td[2]/input", "xpath:idRelative"], ["xpath=//td[2]/input", "xpath:position"] ], "value": "" }, { "id": "cedc9867-0ef9-4cd3-ad2d-b9d498b86325", "comment": "", "command": "waitForElementEditable", "target": "name=password", "targets": [], "value": "30000" }, { "id": "1a67e6fa-739b-473c-bb96-8da1fe17c3be", "comment": "", "command": "type", "target": "name=password", "targets": [ ["name=password", "name"], ["css=tr:nth-child(2) input", "css:finder"], ["xpath=//input[@name='password']", "xpath:attributes"], ["xpath=//div[@id='mainBody']/form/div/div[2]/div/table/tbody/tr[2]/td[2]/input", "xpath:idRelative"], ["xpath=//tr[2]/td[2]/input", "xpath:position"] ], "value": "" }, { "id": "c2235a4f-7995-4975-80b9-da26e0340644", "comment": "", "command": "click", "target": "css=input[type = 'submit']", "targets": [ ["css=.btn", "css:finder"], ["xpath=//input[@value='Log in!']", "xpath:attributes"], ["xpath=//div[@id='mainBody']/form/div/div[2]/div/table/tbody/tr[4]/td/input", "xpath:idRelative"], ["xpath=//tr[4]/td/input", "xpath:position"] ], "value": "" }, { "id": "b60a0d1f-3535-4aac-bb34-7669046fa1a8", "comment": "", "command": "click", "target": "id=tmBP", "targets": [ ["id=tmBP", "id"], ["linkText=Bonus: 6167", "linkText"], ["css=#tmBP", "css:finder"], ["xpath=//a[contains(text(),'Bonus: 6167')]", "xpath:link"], ["xpath=//a[@id='tmBP']", "xpath:attributes"], ["xpath=//div[@id='userStat']/a[2]", "xpath:idRelative"], ["xpath=//a[contains(@href, '/store.php')]", "xpath:href"], ["xpath=//a[2]", "xpath:position"], ["xpath=//a[contains(.,'Bonus: 6167')]", "xpath:innerText"] ], "value": "" }, { "id": "6719258b-d0e0-4df6-b611-6a5dea9472d6", "comment": "", "command": "click", "target": "id=uploadCredit", "targets": [ ["id=uploadCredit", "id"], ["css=#uploadCredit", "css:finder"], ["xpath=//h2[@id='uploadCredit']", "xpath:attributes"], ["xpath=//div[@id='mainBody']/div/div[2]/div/h2", "xpath:idRelative"], ["xpath=//h2", "xpath:position"], ["xpath=//h2[contains(.,'Buy upload credit')]", "xpath:innerText"] ], "value": "" }, { "id": "8353cbe0-6154-4ee4-96e7-da212a5abbf8", "comment": "", "command": "storeText", "target": "id=currentBonusPoints", "targets": [], "value": "bonusPoints" }, { "id": "1a3b44f2-6879-43c5-b309-be08496b614f", "comment": "", "command": "if", "target": "${bonusPoints} >= 500", "targets": [], "value": "" }, { "id": "61468826-bcb6-4b66-b724-845b7dcbd16a", "comment": "", "command": "executeScript", "target": "return Math.floor(Number(${bonusPoints}) / 500);", "targets": [], "value": "times" }, { "id": "ba9b7959-66ca-4e6a-93b7-43c0ff7435ac", "comment": "", "command": "while", "target": "${times} >= 1", "targets": [], "value": "" }, { "id": "3589783a-d8a8-4564-8bc9-b3c481c0455f", "comment": "", "command": "click", "target": "css=.uploadCreditContent > button:nth-child(4)", "targets": [ ["css=.uploadCreditContent > button:nth-child(4)", "css:finder"], ["xpath=//button[@value='1']", "xpath:attributes"], ["xpath=//div[@id='mainBody']/div/div[2]/div/div/button", "xpath:idRelative"], ["xpath=//button", "xpath:position"], ["xpath=//button[contains(.,'1 GB')]", "xpath:innerText"] ], "value": "" }, { "id": "f3dec27f-67e3-47ba-8d1c-db41df77abd7", "comment": "", "command": "click", "target": "css=.ui-button:nth-child(1)", "targets": [ ["css=.ui-button:nth-child(1)", "css:finder"], ["xpath=(//button[@type='button'])[2]", "xpath:attributes"], ["xpath=//body[@id='siteMain']/div[7]/div[3]/div/button", "xpath:idRelative"], ["xpath=//div[3]/div/button", "xpath:position"], ["xpath=//button[contains(.,'Ok')]", "xpath:innerText"] ], "value": "" }, { "id": "548277ae-30f0-46d9-9038-b17bf99d58be", "comment": "", "command": "click", "target": "css=.ui-button:nth-child(1)", "targets": [ ["css=.ui-button:nth-child(1)", "css:finder"], ["xpath=(//button[@type='button'])[2]", "xpath:attributes"], ["xpath=//body[@id='siteMain']/div[7]/div[3]/div/button", "xpath:idRelative"], ["xpath=//div[3]/div/button", "xpath:position"], ["xpath=//button[contains(.,'Ok')]", "xpath:innerText"] ], "value": "" }, { "id": "4a7f07e2-3e43-4740-a9a2-1a81912cb8c3", "comment": "", "command": "executeScript", "target": "return Number(${times}) - 1;", "targets": [], "value": "times" }, { "id": "b3f49c49-4cc8-43ff-b9e8-4d541393fca1", "comment": "", "command": "pause", "target": "1000", "targets": [], "value": "" }, { "id": "6d41bc5a-ec2d-4f66-afbc-9ee50d941166", "comment": "", "command": "end", "target": "", "targets": [], "value": "" }, { "id": "9dc9abda-d98a-47bc-82df-3fdcaa31baf3", "comment": "", "command": "end", "target": "", "targets": [], "value": "" }, { "id": "b4a877bc-764c-4fef-b188-acebe3b47b06", "comment": "", "command": "click", "target": "id=userMenu", "targets": [ ["linkText=Log Out", "linkText"], ["css=li:nth-child(15) > a", "css:finder"], ["xpath=//a[contains(text(),'Log Out')]", "xpath:link"], ["xpath=//ul[@id='menu']/li[2]/ul/li[15]/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/logout.php')]", "xpath:href"], ["xpath=//li[15]/a", "xpath:position"], ["xpath=//a[contains(.,'Log Out')]", "xpath:innerText"] ], "value": "" }, { "id": "2a0fe5cc-af71-4aed-b83f-957a09f8be59", "comment": "", "command": "mouseOver", "target": "linkText=Log Out", "targets": [], "value": "" }, { "id": "1a0579a7-692e-43f9-affe-dcb47e2a836a", "comment": "", "command": "click", "target": "linkText=Log Out", "targets": [], "value": "" }] }], "suites": [{ "id": "14531534-2822-4642-885d-c4ffdb220d16", "name": "Default Suite", "persistSession": false, "parallel": false, "timeout": 300, "tests": ["01add63d-5230-4e52-ac6c-b5ab486fac17"] }], "urls": ["https://www.myanonamouse.net/"], "plugins": [] }