| || |
We have to test an application in different languages. Can anyone share the approach for the same /experiences?
Do we re-record the script for each language? Otherwise how do we handle the object properties???
I haven't such experience, but i'll try to help you.
Try to use ObjectProperties as parameters. Go to the Object Repository, and necessary object properties select as Parameter, not constant.
For example if you have links on the page. All object properties can be the same except "text" properties. So this property can be by parameter, which can be taken from DataTable.
I hope it will help you.
Are the pages identical in all respects except for the language? Do all objects support same properties? Are there images with different language content???
(I'm hiring Software Development Engineers in Test in Seattle, WA)
I write fully DP scripts which have to run on the UK, French & German versions of our website.
I am lucky that the 3 locales are supported by the same development teams so there is a pattern to which objects are common and which are unique to each locale.
The differenecies for me are the Images and the Links.
I get round this by creating a seperate VBS file for each locale and when entering the different descriptions for each.
At execution time I pull in the required locale from an ini file or the datatable and have the following statement at the top of each action:
Select Case Environment.Value("udevLocale")
Here's an example of the Continue link definition from each VBS file:
toContinue = "innerText:=Continue"
toContinue = "innerText:=Weiter"
toContinue = "innerText:=Continuer"
Now when I run the script the following statement will click the Continue link for the relevant locale:
Let me know if you need any further information.
Thank you everyone...any more inputs?
I had the same problem, we managed it by 2 differents way:
1: We asked the developpers of the site to integrate fixed properties in the html code of the site, the chosen identifiers are the ID properties of the html beacons.
With that each object is recognized independently of the text displayed on screen or the pointed URL address. In the Object Repository, identify each object only by their "html id".
This helps for the maintenance of the tests, if the identifiers stay the same for one release to another.
2: The second way of internationalization was for the text or link objects that couldn't have an identifier.
This was done by using an Excel sheet containing all the words needed, their translation and an identifier. This file was build by using the site's diectionnary. The sheet was loaded in Quick Test at the beginning of each test and after detecting the actual language of the site, the DataTable's active line selector was set to the line corresponding to the wanted language. In the object repository, for each object defined like that, you select the property as Parameter value, Select DataTable and enter the column of the needed sentence.
I Hope that was clear [img]images/icons/smile.gif[/img]
I have just started using QTP, so I'll apologise in advance if there is an obvious answer for this.
I was wondering why I can't use the "title" attribute of an html link to identify the link object?
I have the following link on my page
<a href="XXX" title="cmpLink">company</a>
The text "company" can change as the language changes. What I want to do is use the title "cmpLink" in the link instead of the text "company" to identify the object in the page.
Using the recorder, I selected the link and I got the following in the script
I selected the Object Properties from the link and on the dialog, selected "Enable smart identification" and added "title" and set it's constant value to "cmp" and removed text with the value of "company".
When I did that, I expected the script above to change from Link("company") to something like Link("title=cmp") (in pseudo code).
But when I run the script, it fails to find the link.
Although Mark's solution is good for internationalisation, it is more involved than this.
Milind I don't think that you can use title for a link object.
In this scenario I have used innerText but I don't think this is useful to you and html id, I think this may be useable, something like:
Browser("micClass:=Browser").Page("micClass:=Page" ).Link("html id:=XXX").Click
The html id can be identified by using the object spy on the link (although this may not be the same for every company, if that is so you will need to identify a RO property that is static).
Thanks. That worked. I used "html id" instead of "title" in the object properties. The interesting thing is that in the script it stayed as Link("company")instead of Link("html id:=cmp"). But it continued to work when I changed the text from "company" to something else.
I have static links so this is a good solution for me. For dynamic links, I'll take a look at using VB scripts. I haven't used Basic for 20 years!