Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

IDE does not correctly convert the exact pattern. #8473

@lukeis

Description

@lukeis

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions