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

IDE does not correctly convert the exact pattern. #8473

Open
lukeis opened this issue Mar 4, 2016 · 2 comments
Open

IDE does not correctly convert the exact pattern. #8473

lukeis opened this issue Mar 4, 2016 · 2 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

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
Copy link
Member Author

lukeis commented Mar 4, 2016

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

  • Labels added: Component-IDE

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

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

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant