Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
Arahant
Active particpant
Active particpant
Posts : 23
Join date : 2012-02-29

unable to locate dynamic web element. Empty unable to locate dynamic web element.

Mon May 28, 2012 1:43 pm
I tried so many times below snippet but did not work.Error is Unable to locate element: {".//*[@id='mathq2']"}

driver.get("http://timesofindia.indiatimes.com/");
Thread.sleep(2000L);
String text = driver.findElement(By.xpath(".//*[@id='mathq2']")).getText();
System.out.println("text --->" +text);

If any help is appreciated in advance.

Thanks,
Arahant
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

unable to locate dynamic web element. Empty Re: unable to locate dynamic web element.

Mon May 28, 2012 2:43 pm
I have tried below code and is working for me
Code:
String test = driver.findElement(By.id("mathq2")).getText();
System.out.println(test);
avatar
ashish_techie
Amateur
Amateur
Posts : 73
Join date : 2011-08-09

unable to locate dynamic web element. Empty Re: unable to locate dynamic web element.

Tue May 29, 2012 1:56 pm
I think you have to remove the dot from the dot form the xpath. Never have '.' in your xpath.


Regards
Ashish Thakur


For Selenium training contact visit www.qtpselenium.com/selenium-taining
Sponsored content

unable to locate dynamic web element. Empty Re: unable to locate dynamic web element.

Back to top
Permissions in this forum:
You cannot reply to topics in this forum