<commit_before>var webdriver = require('selenium-webdriver')
var By = require('selenium-webdriver').By
var until = require('selenium-webdriver').until
var driver = new webdriver.Builder().forBrowser('firefox').build();

// NAVIGATE TO HOME PAGE

driver.get('http://localhost:3000/');
printURL()

// NAVIGATE TO EDIT PAGE

driver.findElement(By.className("btn-edit-robot")).click();
printURL()


// CLEAR FORM VALUES

printFormValues()
clearFormValues()
printFormValues()

// SUBMIT FORM
driver.findElement(By.xpath('//button[@type="submit"]')).click();
printURL()
printMessages()

//
// HELPER FUNCTIONS
//

function printURL(){
  driver.getCurrentUrl().then(function(url){
    console.log(url);
  })
}

function printFormValues(){
  driver.findElement(By.name('robotName')).getAttribute("value").then(function(inputVal){
    console.log("robotName -- ", inputVal)
  })

  driver.findElement(By.name('robotDescription')).getAttribute("value").then(function(inputVal){
    console.log("robotDesc -- ", inputVal)
  })
}

function clearFormValues(){
  //driver.findElement(By.name('robotName')).sendKeys("")
  driver.findElement(By.name("robotName")).then(function(element){
    element.clear()
  })

  //driver.findElement(By.name('robotDescription')).sendKeys("");
  driver.findElement(By.name("robotDescription")).then(function(element){
    element.clear()
  })
}

function printMessages(){
  driver.findElements(By.css("div .alert"))
    .then(function(messages){
      messages.forEach(function(message){
        message.getText()
          .then(function(messageText){
            console.log("MESSAGE", messageText)
          })
      })
  })
}<commit_msg>achieving workaround also with selenium-webdriver library<commit_after>var webdriver = require('selenium-webdriver')
var By = require('selenium-webdriver').By
var until = require('selenium-webdriver').until
var driver = new webdriver.Builder().forBrowser('firefox').build();

const BACKSPACE_UNICODE = "\uE003";

// NAVIGATE TO HOME PAGE

driver.get('http://localhost:3000/');
printURL()

// NAVIGATE TO EDIT PAGE

driver.findElement(By.className("btn-edit-robot")).click();
printURL()


// CLEAR FORM VALUES

printFormValues()
clearFormValues()
printFormValues()

// SUBMIT FORM
driver.findElement(By.xpath('//button[@type="submit"]')).click();
printURL()
printMessages()

//
// HELPER FUNCTIONS
//

function printURL(){
  driver.getCurrentUrl().then(function(url){
    console.log(url);
  })
}

function printFormValues(){
  driver.findElement(By.name('robotName')).getAttribute("value").then(function(inputVal){
    console.log("robotName -- ", inputVal)
  })

  driver.findElement(By.name('robotDescription')).getAttribute("value").then(function(inputVal){
    console.log("robotDesc -- ", inputVal)
  })
}

function clearFormValues(){
  //driver.findElement(By.name('robotName')).sendKeys("")
  driver.findElement(By.name("robotName")).then(function(element){
    element.clear()
    element.sendKeys(" ")
    element.sendKeys(BACKSPACE_UNICODE)
  })

  //driver.findElement(By.name('robotDescription')).sendKeys("");
  driver.findElement(By.name("robotDescription")).then(function(element){
    element.clear().then(function(){
      element.sendKeys(" ").then(function(){
        element.sendKeys(BACKSPACE_UNICODE)
      })
    })
  })
}

function printMessages(){
  driver.findElements(By.css("div .alert"))
    .then(function(messages){
      messages.forEach(function(message){
        message.getText()
          .then(function(messageText){
            console.log("MESSAGE", messageText)
          })
      })
  })
}
{'fraction_non_alphanumeric': 0.17766638819270397, 'fraction_numerical': 0.003063213589529379, 'mean_word_length': 4.5863141524105755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7176341', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1126, 'n_words': 149}