Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by soumyamishrav@gmail.com

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

View previous topic View next topic Go down

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

Post by ranjan.sarkar@tcs.com on 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

ranjan.sarkar@tcs.com

Posts : 2
Join date : 2011-02-01

Back to top Go down

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

Post by Adviser on 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

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

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

Post by auto_ashish1 on 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

auto_ashish1
Active particpant
Active particpant

Posts : 21
Join date : 2011-03-10

Back to top Go down

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

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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