- Sel_Tester
- Posts : 3
Join date : 2011-09-07
unable to fetch the text in the page using gettext command
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
- Unable to enter text into the Code mirro text box
- Verify text present when the text appears in more location in the page
- Unable to run the command 'captureEntirePageScreenshot' in some Browsers
- Command for auto populated text verification.
- Unable to enter value into text box (id is generated dynamically)