Successive errors when trying to 'Run' the recorded script [duplicate] - coded-ui-tests

This question already has an answer here:
Visual Studio Coded UI test won't run - startup object empty
(1 answer)
Closed 5 years ago.
I created a brand new Coded UI Project and started to record the project. Once, I was done with recording, I click Generate code to create the code for the script.
When I click the 'Start' button after clicking 'Build' > 'Build Solution', I run into the following error: 'A Project with and Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project'
So, I went ahead right clicked the project and clicked 'Set as Startup Project' and saved and tried to run again. However, still the issue was not resolved.
I also right click the project and went to its Properties > Application > change output type to Windows Application'. Then, I get the error message 'Program does not contain a static Main method suitable for an entry point'
When I google the solution for this, the solution is to change it back to output type Class Library'
So, basically it keeps going back and forth and one solution actually leads to error for the other.
Is there a way I can Play the recorded piece by resolving these errors?

The issue is that the coded UI tests are a class library, and per the error they cannot be started.
To sole this:
You can write a program to launch them through something such as a terminal - this occasionally seen done with selenium based tests
You can right click on the test method and click "Debug Tests", or "Run Tests", depending on what you want to do.
You can click on the windows drop down, select "Test Explorer, build the solution, and run/debug accordingly from there..

Related

Plug-in org.springsource.ide.eclipse.commons.gettingstarted was unable to load class

Version: 3.8.2.RELEASE
Build Id: 201610040743
Platform: Eclipse Neon.1 (4.6.1)
This is my version
Plug-in org.springsource.ide.eclipse.commons.gettingstarted was unable to load class org.springsource.ide.eclipse.commons.gettingstarted.dashboard.WelcomeDashboard
It can depends on your OS, as seen here
The 'WelcomeDashboard' uses JavaFX which requires Java 1.8 and GTK2 on unix systems. Eclipse 4.4 runs with GTK3 by default.
As mentioned in issue 252,
The error log probably contains more detailed information and/or other errors that might help determine why this class could not be loaded. You can use menu "Window >> Show View >> Other >> Error Log" to show the error log.
Maybe something indicative of problems activating bundles. The reason the class can't be found is probably because some bundle requirement aren't satisfied on startup.
you could also try to open a console view, switch to the Host OSGI Console, and try a > diag org.springsource.ide.eclipse.commons.gettingstarted to see if there is a problem with that bundle (not resolved for any reason, for example).
As in:
You would see typically:
The same issue adds:
You can use the 'Old Dashboard' as a workaround. It offers the same functionality as the one that for still unknown reason isn't work for you. To switch to the old dashboard do as follows:
Go to Menu "Window >> Preferences".
Search for 'dashboard'. Then select 'Use Old Dashboard' as in the screenshot below.
Then click the 'Apply and Close' button to save the changed setting.
Then close the 'new dashboard' (that is the view in your screenshot that has the error in it).
Now you can reopen the dashboard by clicking on the Dashboard icon in the toolbar. I.e. this one:

VB6: Name conflicts with existing module, project, or object library

Opening a VB6 Project, I get errors like:
Errors during load. Refer to xyz.LOG
I open the log file and see these errors:
Line 42: Class Threed.SSPanel of control XYZ was not a loaded control
class.
In this case I can see the problem is due to the Sheridan 3D Controls: C:\WINDOWS\system32\THREED32.OCX
I thought the project was missing a component so, VB6 > Project > Components > tick the Sheridan 3D Controls and got this error:
---------------------- Microsoft Visual Basic ---------------------------
Name conflicts with existing module, project, or object library
--------------------------- OK Help ---------------------------
I will give you the best way to get rid of this problem. I came across many ways, but this is the most best way to deal with..
Close the project. Right click on the vb project and open with notepad (not with vb). This Project file will only consist of all the references, libraries and information about forms and modules used in the project.
Now just remove the conflicting module or component file, you have problem, by just deleting the entire line.. Save and close it
and now open the project and add component. I swear you wont get that error.
Thank you. Enjoy
The way to troubleshoot this problem is to start a new VB6 project > Project Menu Components > tick the Components that are selected in the affected project until you get the error.
---------------------- Microsoft Visual Basic ---------------------------
Name conflicts with existing module, project, or object library
--------------------------- OK Help ---------------------------
You need to narrow it down to the two OCX's that are conflicting.
In my case I narrowed it down to Sheridan 3D Controls / THREED32.OCX and Outrider Spin Control / SPIN32.ocx
To fix the problem I used RegSvr32 to unregister the OCXs - make sure you UNregister with the /u flag.
REGSVR32 "C:\WINDOWS\system32\THREED32.OCX" /u
I then copied the OCX's to the project folder and registered them again using:
REGSVR32 "C:\Dev\Project\THREED32.OCX"
Then in the project with the problem > Project Menu Components > select the item in the listbox Sheridan 3D controls / THREED32.ocx (you cant tick without getting the error or untick the conflicting one that is selected as its in use) > click Browse and reference it from the project folder rather than C:\WINDOWS\system32\
Another trick is close the project and unregister the affected ocx - make sure you UNregister it with the /u flag, eg
RegSvr32 "c:\Windows\system32\mscomctl.ocx" /u
Then open the project > Components > and you should see the "Microsoft Windows Common Controls 6.0 (SP6)" is using a OCX file in C:...\Microsoft Vi..\VB98\mscomctl.ocx" rather than c:\Windows\system32\mscomctl.ocx.
The project should then load without these errors:
Errors during load. Refer to xyz.LOG
Try unchecking the latest object library / reference from the references and check it again and then go for your desired reference (vb6 has few bugs which can be countered by a reverse process). I solved the error mentioned using this process.

Deleting splash screen gets strange error VS 2013

I had a project with a splash screen. It was giving me trouble so I removed my application framework.
I.e. I did:
-Created a module to be the sub main
-In module create new() splash screen instance and main window instance to run application
-Went to project properties and disabled application framework
This worked without a problem. So I wanted to change my splash screen image, so I replaced the background image. When I did that I got this error:
"Two output file names resolved to the same output file path \obj\debug\.ACFSplashscreen.resources"
Which was weird. So I deleted that splash screen class, and decided to start clean. I still have that error. So I went into my file system and deleted that resources file. Now I have a new error saying it's unable to open it!
How can I find out what is looking for that file and fix it? Nothing in my code calls it anymore.
So as to have an "answer to your question";
Sometimes, if you delete a resource, it requires a simple clean of your project, followed by a build. This has been explained below:
From Microsoft
delete any intermediate and output files. With only the project and
component files left, new instances of the intermediate and output
files can then be built.
Hence, allowing you to 'fix' your error.

CodedUI Visual Studio: How to wait for browser load

I was wondering if anyone new how to make the Automation Script in CodedUI wait for the web page to load before continuing on with the script.
So I fill out a form and press the "Continue" button, then the script times out because it gives up waiting. I realise I could use Playback.wait but then I would have code this each time I click continue.... and I have hundreds of scripts! Something similar to Seleniums WaitforBrowserLoad but for CodedUI
C# CodedUI in VS 2012
Any help would be appreciated.
In my experience, Coded UI is excellent about waiting for page loads to be complete before continuing test execution. That said, you can force a wait for a specific control to exist with WaitForControlExist method. This method is a member of the base class of all UI controls, UITestControl.
You could also use:
Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads;
Sounds like your issue could be fixed if you create a settings file and increase the timeout.
Directions Here: Specifying Test Settings in Visual Studio
You could also call the WaitForControlReady method on the browser window object.
ex:
_browserWindow.WaitForControlReady(60000); //Should wait for 1 min

Error opening nib in xcode: Error updating Objective-C type information. Multiple types...registered with the same Objective-C name: AppDelegate

Just getting started with xamarin studio and iOS development... I'm trying to set up my development projects. When setting all this up, I had initially created a project called 'MyProject.iOS'. I later decided that I didn't want the 'p' in MyProject to be capitalized. I deleted the existing project (using finder), removed it from my existing solution, and created a new one named 'Myproject.iOS'.
Now, when I try to open the Myproject_iOSViewController.xib file to edit in xCode, I get the following error:
Error updating Objective-C type information. Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
Seems like something is stuck in xCode from my original project that had the same name w/ different casing. I looked in Finder and confirmed that all the old files are gone.
I believe I am experiencing the same issue that was reported here (not sure why this issue is marked as resolved): https://bugzilla.xamarin.com/show_bug.cgi?id=7550
The last commenter has a great repo and reports this solution that worked for him:
1. Close XS
2. Delete ~/Library/Caches/XamarinStudio-4.0 folder
3. Open XS : voilĂ  everything works again now !
My issue at this point is that I cannot find the ~/Library/Caches/XamarinStudio-4.0 to delete. I found a ~Library/Caches/ folder but it did not have a XamarinStudio-4.0 sub-folder in there. How can I resolve this?
I am using 4.0.9 (Build 12) of Xamarin studio.
Here is the full stack trace from the error message box that shows up when I double click the xib file:
System.ArgumentException: Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update () [0x00118] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:98
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update (Boolean force) [0x0000c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:72
at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateTypes (IProgressMonitor monitor) [0x0003c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:476
I just had this problem. I used that post to solve it. At first I could not find the folder that is referenced. This is how I found it.
Go into finder on the Mac.
Under Favorites on the left of the screen, select the primary volume. For me that was labeled Macintosh HD.
Select Go/Go to Folder from the toolbar.
In the Go to the Folder screen that pops up type in ~/Library.
From there you can navigate to the proper directory and delete it.
Hope that helps. Best of luck.

Resources