selenium-google-code-issue-archive icon indicating copy to clipboard operation
selenium-google-code-issue-archive copied to clipboard

IDE does not correctly convert the exact pattern.

Open lukeis opened this issue 8 years ago • 2 comments

Originally reported on Google Code with ID 8473

What steps will reproduce the problem?

 1.Open the Selenium IDE.
 2.Enter "exact:test*" in the Value field when create a new command.
 3.Save the test case using File => Export Test Case => Java / JUnit4 / WebDriver.
 4.Generate the following code.
   assertTrue(driver.findElement(By.name("btnK")).getAttribute("value").matches("^exact:test[\\s\\S]*$"));

What is the expected output? What do you see instead?

 IDE should not convert the exact pattern into the code using regular expression.
 I expected to generate the following code.
 assertEquals("test*", driver.findElement(By.cssSelector("form")).getText());

Selenium version: Selenium IDE 2.8.0
OS: Windows 7
Browser:Firefox
Browser version:35.0.1

Please provide any additional information below. 

The expected code is generated when the following code add to the default format.

// Override chrome://selenium-ide/content/formats/webdriver.js#seleniumEquals
var orgSeleniumEquals = seleniumEquals;
seleniumEquals = function(type, pattern, expression) {
  if (type != 'String[]' && type == 'String' && pattern.match(/^exact:/)) {
      pattern = pattern.replace(/^exact:/, '');
      return new Equals(xlateValue(type, pattern), expression);
  } else {
      return orgSeleniumEquals(type, pattern, expression);
  }
}


Reported by sano.nec on 2015-02-09 09:33:27

lukeis avatar Mar 04 '16 09:03 lukeis

Reported by barancev on 2015-02-12 21:07:09

  • Labels added: Component-IDE

lukeis avatar Mar 04 '16 09:03 lukeis

Reported by luke.semerau on 2015-09-17 17:47:30

  • Labels added: Restrict-AddIssueComment-Commit

lukeis avatar Mar 04 '16 09:03 lukeis