07-23-2008, 11:03 PM
This is interesting........let's start by attacking the first part of the problem
1) I am assuming that the text to be compared is being displayed on a webpage. If it is, you can use DOM functions and get all the text that is being displayed on the page. An ex:
If you want to extract text from let's say List, the text would be embedded in the LI tag of the page. We can use the following code to extract the text
Now Lsts is an array containing all the text embedded in all the LI tags on that page.
2) Now using FSO or filesystemobject you can import the file which has all the text that is supposedly the expected text on the webpage.
3) Doing an instr or strcmp of both 1 and 2 would solve the problem
ex:
I just gave a high level example, but this is just an idea if you feel this is ok you can start building upon it.
All the best.
1) I am assuming that the text to be compared is being displayed on a webpage. If it is, you can use DOM functions and get all the text that is being displayed on the page. An ex:
If you want to extract text from let's say List, the text would be embedded in the LI tag of the page. We can use the following code to extract the text
Code:
Lsts = Browser("Title:=.*).Page("Title:=.*").object.GetElementsByTagName("LI")
2) Now using FSO or filesystemobject you can import the file which has all the text that is supposedly the expected text on the webpage.
3) Doing an instr or strcmp of both 1 and 2 would solve the problem
ex:
Code:
for each Lst in Lsts
if instr(1,Lst.innertext, ExpectedText,1)>0
Reporter.ReportEvent micPass
Else
Reporter.ReportEvent micFail
End if
Next
I just gave a high level example, but this is just an idea if you feel this is ok you can start building upon it.
All the best.