selenium-google-code-issue-archive
selenium-google-code-issue-archive copied to clipboard
IDE does not correctly convert the exact pattern.
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
Reported by barancev
on 2015-02-12 21:07:09
- Labels added: Component-IDE
Reported by luke.semerau
on 2015-09-17 17:47:30
- Labels added: Restrict-AddIssueComment-Commit