Before you start
Please read the license agreement if you want to use this software.
Selenium Unit Testing
You can use OpenBullet to perform browser-based tests on web pages and see how they react. We will show a SUCCESS status when our test passed and a FAIL when it does not.
First of all create a Config, go to the Other Options > Selenium tab and tick the two boxes on the left: Always Open browser at the start and Always Close browser at the end.
Then go to the Stacker tab, click on the Switch to LoliScript button and paste the code below.
NAVIGATE "https://google.com"
IF "<BOTNUM>" EqualTo "0"
PRINT To debug the single tests, change the IFs below so that BotNum equals 0, which is the bot number of the debugger.
ENDIF
IF "<BOTNUM>" EqualTo "1"
ELEMENTACTION SELECTOR "[spellcheck=false]" SendKeys "Hello World"
BROWSERACTION SendKeys "<ENTER>"
PARSE "<SOURCE>" CSS "div.r a h3" "innerHTML" -> CAP "RESULT"
IF "<RESULT>" Contains "Wikipedia"
SET STATUS SUCCESS
ENDIF
IF "<BOTNUM>" EqualTo "2"
ELEMENTACTION SELECTOR "[spellcheck=false]" SendKeys "Firefox"
BROWSERACTION SendKeys "<ENTER>"
PARSE "<SOURCE>" CSS "div.r a" "href" -> CAP "RESULT"
IF "<RESULT>" Contains "mozilla.org"
SET STATUS SUCCESS
ENDIF
IF "<STATUS>" EqualTo "NONE"
SET STATUS FAIL
ENDIF
After that, go back to the Other Options > General tab and set the Recommended bots to 2 since we have to perform 2 tests.
Finally, save the Config, create a Runner, import a 2-line Wordlist and the newly created Config and click START. If everything is done right, the Runner should output 2 Hits and 0 Fails.