if (child instanceof DomText) {
if (child.isDisplayed()) {
String textToAdd = ((DomText) child).getData();
textToAdd = textToAdd.replace(nbspChar, ' ');
textSoFar.append(textToAdd);
}
continue;
}
So it on purposely skip the text if it's not being displayed on the
page. My question is that what if I want to get this text? Thanks!
> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>
>
>
On Jan 14, 3:12 am, Daniel Wagner-Hall <dawag...@gmail.com> wrote:
> String innerText = ((JavascriptExecutor)driver).executeScript("return
> arguments[0].innerText", element);
>
If I recall correctly, this used to be possible.
On Jan 14, 6:55 pm, William S <sars...@gmail.com> wrote:
> Thank you!
>
> On Jan 14, 3:12 am, Daniel Wagner-Hall <dawag...@gmail.com> wrote:
>
>
>
> > String innerText = ((JavascriptExecutor)driver).executeScript("return
> > arguments[0].innerText", element);
>
> > On Wed, Jan 13, 2010 at 11:15 PM, William S <sars...@gmail.com> wrote:
> > > I am trying to get some text which is of ahiddenWebElement and I
-- Jason
On Jan 18, 10:47 am, Jason Leyba <jmle...@gmail.com> wrote:
> We try not to let you do things with WebDriver that a user couldn't
> do. For instance, if a user can't see a button, they can't click it,
> so neither can WebDriver. Likewise, a user wouldn't be able to see
> the text of a hidden element, so WebDriver will return an empty
> string.
>
> -- Jason
>
you can test the value changes by editing whatever you trigger the
change (from another element that is editable or not hidden) then
confirming with javascript or such.
The restriction we place is that if a user would perform the action
you're requesting with a keyboard or mouse (that is, things like
clicking, selecting or typing) then the element must be visible
(otherwise how would the user perform the same actions) This means
that the tests you write not only exercise the raw HTML of the page,
but also verify that a user could use your site the way your tests say
they should.
Regards,
Simon
<input type="hidden" name="mylogin" id="mylogin" value="1"/>
I am trying to get the value of this webelement to check successful login ....and seeing 'Unable to locate element:' error...Here is what I tried:
String P =driver.findElement(By.name("mylogin")).getText();
driver.findElement(By.name("mylogin")).getAttribute("value");
driver.findElement(By.xpath("//input[@id='mylogin']")).getAttribute("value");
Thanks,
Latha.