UFT error: Cannot identify the object - object

I'm using Unified Functional Testing v12.02 (or QTP).
Sometimes while running script i get the below error and sometimes I don't.
Cannot identify the object "..." (of class ...) Verify that this
object's properties match an object currently displayed in your
application.
Tip: If the objects in your application have changed, the Maintenance
Run Mode can help you identify and update your steps and/or the
objects in your repository.
I checked OR and the object itself with Spy tool and they have the same properties.
Sometimes I get the same error in other objects, but if I run again the script it works well.
Can someone explain me what might be the problem?
Im a little bit confused why sometimes i get these errors and sometimes don't.
I'm testing a simple web application (for training purposes)
Also I'm using the following add-ins: Web, Web-SAPUI5, Visual Basic

Mostly object wont be in the readystate. Check State of the Object using
Webedit(googlesearch).object.readyState="complete"
Webedit(googlesearch).object.Load
Webedit(googlesearch).object.Disabled=False

Related

NetSuite 2015_2 PHP-SDK Two Factor Authentication

We currently have Two Factor Authentication working in the 2017_2 release of the NetSuite PHP Toolkit, but we have some code that has broken due to changes between 2015_2 and 2017_2. It seems that in 2017_2 it is also far easier to set up Two Factor Authentication.
Looking at the code, however I do see references to TokenPassport and TokenPassportSignature, which tells me that I should be able to get TBA working in 2015_2, which would give us time to figure out the rest of the issues.
My question is: How would I actually go about that? I have set $service->passport to the generated TokenPassport object. I know that my TokenPassport object works in 2017_2, and I assume it would be the same, but I don't know for sure, and I can't seem to find any information up on Elgoog.
ETA: I have seen examples of this working in 2015_2 in Ruby, but not in PHP. The backend is there, but I can't seem to be able to do this in PHP, and the Ruby examples were only snippets.
Okay, so I solved this for myself, but I may not have done it the "right" way. Here's what I did:
I took the makeSoapCall and setTokenGenerator methods from the new instance of NSPHPClient.php, and I added them to the OLD version. I had to modify the setTokenGenerator method to not require an instance of iTokenPassportGenerator, but I could have just as easily copied over that interface as well.
Basically, all that needs to happen is that we need to send the tokenPassport header, which the older version of the SDK can generate but doesn't have a method to actually send that I could find.

Office-js doesn't display the properties

I was trying to repro a tutorial about the creation of an Excel Add-in when something get wrong with the IntelliSense of Visual Studio. I was writing this code:
function updateStocks() {
Excel.run(function (ctx) {
var **range** = ctx.workbook.names.getItem("Stocks")
At this step, everything was fine, but after the getItem, I have tried to add .getRange() at which point the IntelliSense was not able to understand anything related to my variable range.
Screenshot
What is really "funny" is the fact that even if the properties are not displayed, when I write the code of the tutorial manually, the code is executed without mistake.
Why does this behavior occur and how can I correct it?
Are you able to see IntelliSense for other types within that .run? I.e., do you have everything up to the point where you get a Range from a named item? If you were to obtain the range differently (e.g., context.workbook.getSelectedRange()), do you get IntelliSense then?
This might be related to an issue (now fixed) where the CDN accidentally had the namedItem.getRange method removed (it was the only one that was affected, and we've put in measures to ensure we catch those in the future). See "Can't get range from a defined name". The CDN has been patched a couple weeks ago, but the JS IntelliSense file ("VSDOC") probably hadn't. If that's the case, it's a point-in-time issue that should resolve itself very very soon, as new deployments of the CDN will have the getRange method both in the VSDOC and everywhere else.
FWIW, you may still run into limitations of the JS IntelliSense engine (there are plenty, unfortunately: for example, trying to pass values across Promises, or passing in API objects as parameters to functions). The only true good workaround for this is using TypeScript, which allows you to declaratively assert to the compiler/IntelliSense-engine that "I know this type is an Excel.Range!") -- and offers a number of other goodies, async/await being a very major one. I personally believe that if you really want a "premier" Office.js-coding experience, TypeScript is the way to go. To that end, I describe how to use TypeScript in my book, "Building Office Add-ins using Office.js" (full disclosure, I am the author; but I've had many readers comment on how helpful of a resource it's been to them). The book is very much TypeScript-oriented, IntelliSense being one of the reasons (and async/await and let being the primary others) -- though I also offer an Appendix where I describe the JavaScript-only way of accomplishing the same Office.js tasks. It takes only a small amount of effort to get started with using TypeScript, and once you do, I don't think you'll look back.

UFT - Is there a way to look into objects and see what add ins were used while it was added to OR

Is there a way to look into objects and see what add ins were used while it was added to OR
The problem I am facing is when I run the script with different add in than what was used to add, it has issues identifying them. We have different Automation tester who have been using more add-in than required and ended up with the issue.
We would need to clean up and re-add only those which are/will be causing trouble and to do that we would need to know if there a way to find from OR what addins were used when we added the objects into them
Since you're primarily talking about the LOR you can look at the test settings and see which addins are associated with the test.
Then in order to see which test object is associated with each addin you can look in the object identification dialog which filters by addin.
Image thanks to #Vinoth S.

C# Accessing classes in a WinForms project from a classes in a Class Library

I have two c# projects within a solution.
The first project is a winforms project with several classes and is called QuantumGUI. The second project is a class library project with several classes and is called QuantumDAL.
My objective is from a class in QuantumDAL to access and set variables in a QuantumGUI class or and in Form.cs.
I have tried adding a reference to QuantumGUI in my QuantumDAL project but received the following error: “A Reference to ‘QuantumGUI’ could not be added. Adding the project as a reference would cause a circular dependency”.
I received a similar error message trying to add Project Dependencies. When you think about it, the error message makes sense.
I’ve tried other, what I consider possible ways of doing this but came up empty. I believe there must be a clever way of getting this done.
If I’m going about this in a wrong way, is there a way to have a “global” class that can be accessed by code in both projects?
Thank you for taking the time to look at this.
There are two problems with what you're trying to do:
First, as the IDE is warning you, you're about to create a circular dependency. This means that the compiler would need to build project A before it can build project B, but it would need to build project B before it can build project A. Neither project can go "first".
The second problem is that your WinForms project is most likely an executable, and you cannot add references to *.exe files via the IDE. You can add those references via the command-line, but the fact that Visual Studio is trying to stop you from doing it should be a red flag that it's a really bad idea.
The correct way to do what you want is to refactor the common classes into a third class library that you reference from both other projects. If needed, you can wire up events (in particular, look at the INotifyPropertyChanged interface and its event) that notify interested observer objects when things change.

Is there something I can use to neatly visualise JavaScript objects in Chrome?

I am a seasoned C# coder, but quite the JavaScript novice, and I am now trying to get a pure JavaScript component, the very competent Kendo UI DataSource, to talk nicely to my C# MVC3/4 controllers.* I would like to be able to examine certain JavaScript objects so I can fine tune my client side model mapping code, but the view of objects in the Chrome debugging console is a little cluttered and low level.
Is there a Chrome add-in I can use for visualising JavaScript objects while debugging script, and failing that, a nice object visualizer that I can use to output object visualizations as HTML. I can then toggle whether this is active, built a visual object graph for a debugging session, then switch the visualiser off again for normal operations in my client scripts.
** This question is a much broader and differently targetted one that shares only the same goal of my other question, How can I accept JSON requests from a Kendo UI data source in my MVC4 application? However, that question is more technology specific and covers the whole client-server roundtrip, where this one is specific to only visualising JavaScript objects on the client.
EDIT:
Based on suggestions below, console.log does provide adequate output for runtime inspection, but often the console is a busy place, and I would prefer to output a persistent visualization elsewhere, with all properties in the object expanded, but without the 'internals' e.g. __id and __proto, as seen in the image. I would just like to see models as an array of two objects, each with only Id and Name properties.
I find it more useful to send the object to the console than inspect it inside the debugger. It's less cluttered and you don't have to go searching through your code for a breakpoint. If you just do a console.log(object), then hit F12 and select the Console, your object will be sitting there ready to be inspected.
Edit
If you do a console.log on the models property, it will come out like this:
Or, if you prefer, you could use something like this to spit out the information without you having to click any arrows:
function logModels(models) {
for (o in models) for (p in models[o])
console.log(p +'\t' + models[o][p]);
}
Which looks like this:
You can also filter the console to only display Logs by clicking the appropriate button at the bottom of the bar.

Resources