You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.
Hi all,
With 2.1.0, the far below HTML and WebDriver test case works differently with FF 5
/ IE 9 / HtmlUnit 2.8
Output:
IE:
getText() a,a, -> Correct (should it be "a,")
getAttribute() a,a, -> Correct (should it be "a,")
FF:
getText() -> Incorrect
getAttribute() a,a, -> Correct (should it be "a,")
HU:
getText() -> Incorrect (due to WebDriver)
getAttribute() -> Incorrect (due to HtmlUnit)
Please note that HtmlUnit 2.8 behaves correctly for getText(), but not with getAttribute()
which I will try to fix.
----------------------------------
<html><head><title>foo</title><script>
function init() {
var s = document.getElementById('s');
if (s.addEventListener) {
s.addEventListener('click', handle, false);
} else if (s.attachEvent) {
s.attachEvent('onclick', handle);
}
}
function handle(event) {
myTextArea.value += s.options[s.selectedIndex].value + ',';
}
</script></head><body onload='init()'>
<select id='s'>
<option value='a'>A</option>
<option id='opb' value='b'>B</option>
<option value='c'>C</option>
</select>
<textarea id=myTextArea></textarea>
</body></html>
----------------------------------
WebDriver:
WebDriver driver = ....;
driver.get(url);
driver.findElement(By.id("opb")).click();
WebElement e = driver.findElement(By.id("myTextArea"));
System.out.println("getText() " + e.getText());
System.out.println("getAttribute() " + e.getAttribute("value"));
Thread.sleep(3000);
driver.close();
----------------------------------
HtmlUnit:
WebClient webClient = ...;
HtmlPage page = webClient.getPage(url);
page.getHtmlElementById("opb").click();
HtmlTextArea e = page.getHtmlElementById("myTextArea");
System.out.println("getText() " + e.getText());
System.out.println("getAttribute() " + e.getAttribute("value"));
Reported by asashour@yahoo.com on 2011-07-26 10:25:03
The text was updated successfully, but these errors were encountered:
To make this even more complex, try selecting 'B' in real InternetExplorer and Firefox.
With InternetExplorer:
- User must click on the parent 'select', and then he can click 'b'. In other words,
you can't have the output to 'b,' manually.
With Firefox:
- User can click directly to 'b,' without the need to click the 'select' first.
Should those differences be considered?
Reported by asashour@yahoo.com on 2011-07-26 10:34:23
GettingInvolved means this is a good candidate for a bug for someone who wants to start contributing to Selenium to start by looking at, i.e. it's probably not crazily complex, not too huge, and doesn't have much decision-making needed to define the correct answer.
Thanks for the explanation. What about adding a wiki page for the different statii you use for the project's issues?
barancev:
New tests were added by r18247 and r18252
Currently only IE suffers of this issue.
See TextHandlingTest methods testTextOfATextAreaShouldBeEqualToItsDefaultTextEvenAfterTyping and testTextOfATextAreaShouldBeEqualToItsDefaultTextEvenAfterChangingTheValue
Originally reported on Google Code with ID 2131
Reported by
asashour@yahoo.com
on 2011-07-26 10:25:03The text was updated successfully, but these errors were encountered: