Same application on different OS giving different object spy results
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Same application on different OS giving different object spy results
Recently we have started to test our application which has always been on 32 bit OS on 64 bit with a 64bit version of the application. However while the majority of the scripts writen originally for the 32bit version work on the 64 bit, we have found an instance where a button is not recognised as a button via the object spy when it is on 32bit and the code used for 32bit will not work when called to click that button on 64 bit. Is there any reason for this and way to fix it to avoid it should it appear for other buttons in the application?
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you share the object browser screenshot for both the bit version.
Can you confirm, The .Net Package installed is same?
Vallalarasu Pandiyan
https://www.linkedin.com/in/vallalarasupandiyan/
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The one with the name map Cash is 32 bit, the other is 64 bit. As you can see its the same button on both applications but one is seen as a button with a ClickButton option and the other is not. I am not sure what you mean by the .Net package.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like you may have to use a wildcard to map/identify the object, so in stead of ...Grid.Border.Grid.Cash make it ...Grid.Border.Grid.Cash*
That should address this specific issue in multiple environments
Or don't link it the the identifier, but use other unique properties that aren't affected by OS in stead
-------------------------------------------------
Standard syntax disclaimers apply
Regards,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Mark1 ,
if the properties are changing for differnt Bit Operating System, try to find the objecs using Regular Expression.
take the part of property values which is same in both the OS and add "*" where ever the needed(Before or After).
in your case the regular expression somewhat look like below code snippet:
assume if the below is the object's propertyname and values of which you are trying to identify : PropNames = "objectIdentifier" PropValue in 32 Bit = "cash" PropValue in 64Bit = "cash64Bit" Sys.Browser("*").Page(*).FindChild("objectIdentifier", "cash*", 10, true)
NOTE: you can use "*" in prefix,suffix and also in between accordingly
"cash*","*cash","*cash*","ca*h*", etc...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not entirely sure what you mean. I am just trying to click this button regardless of what OS it is. The application being tested is a local exe by the way, its not a web page or browser, just in case that makes any difference.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Mark1 wrote:
The application being tested is a local exe by the way, its not a web page or browser, just in case that makes any difference.
No, the principle is the same. You still need to use the find, just the way you identify is with Sys.Process rather than Sys.Browser
From what I can see is that the button's name changes based on the environment. They both start with"Cash" though. You don't need to get as fancy as regex, as long as you add that "*" It's the same principle as searcing for *.exe which will search all exe files. In this case it will search for all buttons starting with Cash if you use "Cash*" or all buttons ending with Cash if you use "*Cash" or even all buttons that have cash somewhere in the middle like "*cash*"
By using "Cash*" you are telling TC to find the button that ends with anything as long as it starts with Cash and that wil eliminate the variable name.
@Krishna_Kumar is showing how to find the object in script
You can also add wildcards in name mapping e.g.:
If my setup was like yours, this will find the button that my application called btnCancel in 32 bit while finding the button called btnCancel64Bit in the 64 bit environment.
-------------------------------------------------
Standard syntax disclaimers apply
Regards,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Will the fact that the Cash and Cash64 are from name mapping impact this in any way?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Mark1 wrote:
Will the fact that the Cash and Cash64 are from name mapping impact this in any way?
No, it's the same object in the same tree. It's just that the application names it differently - or TC gives it a different ObjectIdentifier (TC infers the name, so 64bit may have been added by TC)
By using "Cash*" in your name mapping properties, it can be the same item in NameMapping window no matter which OS version it is. As long as the Properties identifies one button and no more in any environment, you can use as many properties with as many wildcards as you like. If your properties are to broad with too many wildcards in though, you may find ambigious object recognition errors though, so keep it as exact as possible
-------------------------------------------------
Standard syntax disclaimers apply
Regards,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Mark1 ,
please look inot the image attached below
there is a button which idstr is "idBtn_Back" you can use the direct value or the regularexpression by selecting the elips in rightcorner and edit the extra part by replacing wiht the "*"("idBtn_*")
the below is the button were i am using regular expression
please apply the same logic in your case and let me know .
if it is working please accept the solution.
Kind Regards,
Sathish Kumar K
