Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorial:scripting_state_model [2020/07/17 21:28]
admin [Initialization scripts]
tutorial:scripting_state_model [2020/11/24 22:09]
admin [Activating plugins]
Line 112: Line 112:
    $SYS.log('Random phone#: ' + $RANDOM.randPhone('999-999-9999') );    $SYS.log('Random phone#: ' + $RANDOM.randPhone('999-999-9999') );
        
 +For test automation, for example web application you would activate //Selenium// plugin.  Once you have the plugin activated, you will be able to use //$SELENIUM// to interact with your web application through //Selenium/WebDriver//
 +
 +For example:
 +
 +   $SELENIUM.getWebDriver().findElement(org.openqa.selenium.By.id('Water').click();
 +   
 +You could also use //PAGES// tab to define page object:
 +   //PAGES Script
 +   import org.openqa.selenium.By;
 +   def addMainPage () {
 +      mainPage = $SYS.addPage('MainPage')
 +      elem = mainPage.addElement('DrinkWater', By.id('Water'))
 +      elem.addAction('click', { elem, params ->
 +         $SELENIUM.getWebDriver().findElement(elem.locator).click();
 +      })
 +   }
 +   addMainPage()
 +   
 +Then in //TRIGGERS// tab, you can do this:
 +   $SYS.page('MainPage').element('DrinkWater').perform('click');
 +   
 +
 ===== User variables ===== ===== User variables =====