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
ranjan.sarkar@tcs.com
Posts : 2
Join date : 2011-02-01

How to locate a particular string on a webpage using selenium commands Empty How to locate a particular string on a webpage using selenium commands

Tue Feb 01, 2011 7:27 pm
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
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

How to locate a particular string on a webpage using selenium commands Empty Re: How to locate a particular string on a webpage using selenium commands

Wed Feb 02, 2011 5:59 pm
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
avatar
auto_ashish1
Active particpant
Active particpant
Posts : 21
Join date : 2011-03-10

How to locate a particular string on a webpage using selenium commands Empty Re: How to locate a particular string on a webpage using selenium commands

Wed Apr 06, 2011 2:41 pm
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
Sponsored content

How to locate a particular string on a webpage using selenium commands Empty Re: How to locate a particular string on a webpage using selenium commands

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