--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/cd35fd6a-1b51-49b6-84db-6994101cb47d%40googlegroups.com.
I have used below ways to get the value of the input field which is disabled in Page. Value is not returned with below when it is enabled for Edit then i'm able to get the data with the same XPath.
driver.FindElement(By.XPath("//*[@ng-reflect-name='mobileNumber']")).GetAttribute("value").ToString();
driver.FindElement(By.XPath("//*[@ng-reflect-name='mobileNumber']")).Text;
What does "unable to get the text" mean? How were you unable to get it? getAttribute("value") is indeed how you do this so I don't know what the issue would be. Can you share how you're using it/the page you are using it against?
On Mon, 25 May 2020 at 08:54, Shruthi Donthiri <shruthi...@gmail.com> wrote:
We have a application developed with Angular. And there is a input field which it is read only/disabled. How to get the text of the field.--I have tried to get the text using Text and GetAttribute("value"). But unable to get the text.Can anyone suggest here?
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("document.getElementById('<yourElementID>').setAttribute('type', 'text');");
Then apply getText() command
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f61b97be-d18f-4612-a986-6dabf2f6fbbf%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f61b97be-d18f-4612-a986-6dabf2f6fbbf%40googlegroups.com.
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
var confirmationtext = "return document.evaluate( \"//*[@ng-reflect-name='mobileNumber']\", document, null, XPathResult.ANY_TYPE, null)";
var returnvalue = js.ExecuteScript(confirmationtext);
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.