Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Translation Testing (.NET)
#1
Not Solved
I am going to be using QTP 9.0 to ease the testing of translations with the newest version of our product. I have been looking through the manual and online for tips but haven't come across too much regarding our need. What I want to know is, what would be the best way to go about creating a test for our needs? What I need is:

-Have QTP go through our program and get the text from every object which has text
-Compare them against the strings from an external file (Excel or XML) or the .resx file
-Make sure that the string is fully displayed within the program and not cut off

I have figured out how to fetch the text from all objects I need but I can't figure out the best way to go about comparing them to what they should be. Would it be best to import all the correct strings as Environment Variables or would it be best to import into the DataTable? Is there a way that I can get the only visible text and the full text to compare? Basically I need to figure out if strings are getting truncated by being too long. I would appreciate any help on this. Thanks.
Reply
#2
Not Solved
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
Code:
Lsts = Browser("Title:=.*).Page("Title:=.*").object.GetElementsByTagName("LI")
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:
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.
Reply
#3
Not Solved
This is actually for a .NET program. Our biggest concern is that text is not getting clipped on labels and buttons. I currently have a test which will go through each form we need tested, get all the children into a set and then go through each one and use GetVisibleText and GetROProerty("text"). This will get the text which is actually shown on the program and what is supposed to be shown.

I am having problems though that sometimes the GetVisibleText does not return the entire text. For instance: One of our dialogs has the title "Marks Not Set" but it is clipped off to show "Marks Not S". Running the script brings back "Marks Not Set" for the GetROProperty("text") but for the GetVisibleText it only retrieves "Marks", even though it shows "Marks Not S". Is there a bug with GetVisibleText in v9.0 or should we be going about this a different way? And don't be afraid to use any in-depth answers...I just posted this in the beginner's forum because there wasn't an advanced one Tongue

Oh and another thing. A lot of elements on our forms are dynamically created. I.e. - Dialogs all use the same object, so all the labels and buttons will have the same name for each instance but the actual text will not. This prevents us from using an imported environment variable list containing each control name and text as there would be no way to distinguish between them.
Reply
#4
Not Solved
Sorry Mike,

Havent worked on .Net apps before.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP Automation testing steps for .net web applications? Ramadas 0 2,482 10-30-2013, 12:54 PM
Last Post: Ramadas
Question .net testing, Object not found on object repository error, what am i doing wrong? ptreey 6 6,784 04-08-2011, 12:25 PM
Last Post: invertednz
  Testing tool for .net and Kofax gamey06 0 2,108 01-11-2010, 11:26 PM
Last Post: gamey06

Forum Jump:


Users browsing this thread: 1 Guest(s)