read text from webpage using SilkTest
I need to read text from a webpage from any place. It may be some text in a <Br> </br> tag or in a complex designed table. How to read text using SilkTest for such cases for example, when I login a website I have to write a testcase to verify whether the text "Welcome to test.com" appears in the top most corner.
I have to check for nearly 5-10 text or numbers in a web page like this. Writing 1 test case for each will not make sense as I have 500 test cases like that in different pages across my web site. Instead, I want to write a function which takes in the parameters like the string to be found and verified and the kind of tag or object identifier?
Has anyone done this kind? Please do give me some best practices to verify such kind of functionality.
Thanks in advance.
Re: read text from webpage using SilkTest
try:</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Verify (BrowserPage.HtmlText("Welcome to test.com".Exists (), TRUE)</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">As far as verifying if the text is in the top corner you could call GetRect and verify that it's position falls within a range of accepted values.