How to locate a particular string on a webpage using selenium commands
Page 1 of 1 • Share •
How to locate a particular string on a webpage using selenium commands
I want look for a string in a web page and replace the string with another string. I cannot find out with which selenium command i can do that.Please help.Its urgent
ranjan.sarkar@tcs.com- Posts: 2
Join date: 2011-02-01
Re: How to locate a particular string on a webpage using selenium commands
hi,
If you want to replace the string coming in web element like text field and replace with other string that will be possible.
But if you want to replace the hard code string on weppage which is inside the HTML then You can't. You'll get the all the information present on the page through "view source" command but you'll not able to changed that on browser.
use the following commands
storeAttribute ( attributeLocator, variableName )
Gets the value of an element attribute. Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to get null event arguments. Read the bug for more details, including a workaround.
Arguments:
* attributeLocator - an element locator followed by an
* variableName - the name of a variable in which the result is to be stored.
Returns:
the value of the specified attribute
storeHtmlSource ( variableName )
Returns the entire HTML source between the opening and closing "html" tags.
Returns:
the entire HTML source
Hope this will help you. Best of luck
If you want to replace the string coming in web element like text field and replace with other string that will be possible.
But if you want to replace the hard code string on weppage which is inside the HTML then You can't. You'll get the all the information present on the page through "view source" command but you'll not able to changed that on browser.
use the following commands
storeAttribute ( attributeLocator, variableName )
Gets the value of an element attribute. Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to get null event arguments. Read the bug for more details, including a workaround.
Arguments:
* attributeLocator - an element locator followed by an
* variableName - the name of a variable in which the result is to be stored.
Returns:
the value of the specified attribute
storeHtmlSource ( variableName )
Returns the entire HTML source between the opening and closing "html" tags.
Returns:
the entire HTML source
Hope this will help you. Best of luck
Re: How to locate a particular string on a webpage using selenium commands
You can use any of following
1) storeAttribute ( attributeLocator, variableName )
2) getText ( attributeLocator)
Regards
Ashish
itsthakur@gmail.com
91-9888179981
For online Selenium training go to my website- www.sejsoft.com
1) storeAttribute ( attributeLocator, variableName )
2) getText ( attributeLocator)
Regards
Ashish
itsthakur@gmail.com
91-9888179981
For online Selenium training go to my website- www.sejsoft.com
auto_ashish1- Active particpant

- Posts: 21
Join date: 2011-03-10
Similar topics» How to locate a particular string on a webpage using selenium commands
» Selenium commands
» Selenese-Selenium commands
» String comparison using Selenium Ide
» Creating detail log for selenium command execution (Selenium RC Java client)?
» Selenium commands
» Selenese-Selenium commands
» String comparison using Selenium Ide
» Creating detail log for selenium command execution (Selenium RC Java client)?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum

» sample webdriver code for php users
» which standalone server to use
» Dynamic Drop Down Selection
» It is possible to find list of all URL's exist in any web page in selenium ide
» It is possible to compare 2 same images in selenium IDE.
» how to compare 2 ULR's which is exist in same web page (View page source).
» Web Driver: Unable to click a link present inside the frame of a frameset
» Help me to get dynamicaly loaded options of dropdown in Selenium RC -Junit test case