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
Sel_Tester
Posts : 3
Join date : 2011-09-07

unable to fetch the text in the page using gettext command Empty unable to fetch the text in the page using gettext command

Wed Sep 07, 2011 10:51 am
Hi All,

Thanks for reading my query.
i need some help.
I have a page here which has a header named " System Information" and
then a table.

I have written a piece of code like this :
---------------------------------------------------------------------------­---------------------------------------------------------------------------­----------
public class e
{
static Selenium browser ;
public static void main(String[] args){
browser = new DefaultSelenium("localhost", 4444, "*firefox C:\
\program Files\\Mozilla Firefox\\firefox.exe", "Web_url");
browser.start();
browser.open("web_url");
browser.selectFrame("GB_frame");
browser.type("name=username", "admin");
browser.type("name=password", "admin");
browser.click("name=Submit");
String PageHeader = browser.getText("/html/body/div[@id='shell']/
div[@id='wrapper']/div[@id='outer']/div[@id='center']/
div[@id='containerCenter']/div[1]/div/h1");
System.out.println(PageHeader); }
---------------------------------------------------------------------------­---------------------------------------------------------------------------­-----------
The Xpather shows this : /html/body/div[@id='shell']/
div[@id='wrapper']/div[@id='outer']/div[@id='center']/
div[@id='containerCenter']/div[1]/div/h1
XPath returns these :
- id('containerCenter')/div[1]/div/h1
- //div[@id='containerCenter']/div[1]/div/h1
- /h1.

Using IDE , Verify text works fine.
but using the UI map or once i have the path from XPather / Xpath , it
says command not found or unable to locate the element.

Pleaseee Help.
Regards,
Steve

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