Coded UI Tests aren't doing anything - coded-ui-tests

This is my first look at Coded UI tests. I've hand coded a test that successfully opens the a browser window to my local web project, but then it just sits there and does nothing. I've tried clicking a hyperlink and putting text in a textbox.
I've set a break point and stepped through the code, but nothing ever happens on the page. I'm clearly missing something.

It turned out that it just runs really slow.

Related

When I go into page view in my snapshots I only see, "Navigation to the webpage was canceled". Also weird pop-up when recording

As mentioned in the title when I go into my Snapshots and page view, all I see is "Navigation to the webpage was canceled", or a blank page. Not sure why this is happening but I would like some help, I am new to LoadRunner sorry if this is a stupid question.
Probably relevant to my issue but I also have a weird message when I am initially recording my script, it pops up sometimes and after I press continue it simply records my script seemingly normally. To clarify it does not always appear when I am trying to record in vugen only occasionally, it is seemingly dependent on which website I am trying to record.
Images for both will be attached.
Navigation image
Recording image

How to set up the correct 'View' for VBA Project in Microsoft Excel?

Not sure if this is the correct place to post this but this issue is driving me insane....
The Issue:
I have come to use my PC after the weekend and for some reason the layout of the VBA Project stuff is completely messed up...
Usually when my VBA is set up very nicely in what I believe is the standard viewing mode IE the Project box to the left and the code to right and the intermediate window at the bottom...
For some reason now I get the following:
As you can see it is just the code...
I then click on the project explorer window and the project details appear, but as one ridiculously large page....
Then I minimise the window and alter its shape to try and get it at least look like it used to...
I can live with this to an extent although everything is floating and annoying... But now, every time I click onto a module (to view the code). It opens each module as its own seperate window!
This as you can imagine is unsustainable when working with as lot of code and having to flick between different modules
What I have Tried:
I have tried looking in different settings and I can not see anything different...
I have restarted my PC and it is still the same...
I have tired opening a different spreadsheet and still the same....
Does anyone have any suggestions? I just want it to be back to the simple layout of everything joined together etc...

Can't enter break mode at this time

This has been happening increasingly, when I have a sheets.add or sheets.delete in excel VBA. After searching and searching I finally found the official Microsoft support page on it. My question is, does anyone know why I could have stepped through this code just fine over and over, and then all of a sudden it starts doing what Microsoft says it would always do, and is there a way to fix it?
Sub foo()
Sheets.add
debug.print "sheet added" 'breakpoint here
End sub
It's as simple as that. You won't be able to recreate it, because the issue I'm asking about is the fact that it doesn't happen at first. It works just fine over and over then randomly presents the error described in the linked Microsoft support page.
Check if Microsoft Visual Basic for Applications Extensibility is being referenced in the project.
You can check that in the Tools/References Menu on the Visual Basic window of the project.
Referencing Visual Basic for Applications Extensibility prevents the program having its execution suspended:
Excel helps says specifically:
A change was made programmatically to the project using the extensibility (add-in) object model. This prevents the program from having execution suspended. You can continue running, or end execution, but can't suspend execution.
You are unable to step through code when making changes to the project (dynamically eg using InsertLine etc). the code can be run but not stepped through.
Deleting certain objects including ActiveX objects actually changes the VB project. It took me some time to realize that the following line of code prevented the VBE from entering break mode:
Excel.ActiveSheet.DrawingObjects.Delete
If you can identify the code causing the issue, and the order of operations isn't important, move it to the end of your script.
Here are a few suggestions which are not fool-proof,
Firstly, verify that the error does not occur if a breakpoint is not set.
If it doesn't, try a few other things:
From the VBE Debug menu, "Compile VBA Project", it's worth a shot.
Delete the line entirely. Run the code. Then put the line back in and try again with the breakpoint.
Add a DoEvents statement after the Sheets.Add
Use a MsgBox instead of a breakpoint on a Debug.Print. With the message box displayed, attempt to manually break using ctrl+fn+End. (At this point, "breaking" isn't necessary but it would be interesting to see whether you can break this way)
Put a breakpoint on Sheets.Add instead; practically speaking, there's no reason to put the breakpoint on a Print statement if you can just put it on the preceding line.
Are there any Addins? If so, disable all of them and re-enable one at a time, testing to see which one may contribute to the error.
Yet another Excel/VBA glitch.
When it happens to me when I click a button running a macro:
I first try to directly run the macro from VBE,
if it fails, then I put a breakpoint at the first instruction of the macro,
if it still fails, I try both,
or, after clicking the button and breaking on the first breakpoint, I do a single step (SHIFT F8) and then I can let debug run freely as usual (F5).
And so far I don't get this error anymore.
Probably not foolproof either but worth a try.
Ran into the same issue, and (as far as I can tell) the only relevant answer here is Answer 5 (i.e. the one provided by Chrisb).
I've been working with vba for (too many) years now, and never encountered this until I had a project that needed vba to delete ActiveX controls. In my case, the 'ActiveX controls' were a spurious result of data copied in from a web page.
Additionally, there appears to be a way around the issue. Using the following code (versus, e.g. deleting the ActiveX as a shape), seems to circumvent the issue:
On Error Resume Next
ActiveSheet.OLEObjects.Visible = True
ActiveSheet.OLEObjects.Delete
On Error GoTo 0
I say 'appears' and 'seems' above as implementing the above solved the issue for me. However, before I implemented same, I had made other code changes and I have not yet fully regression tested for all possible other reasons the problem was resolved. :)
This has happened to me multiple times and this solution works for me.
Run a different macro within the same VBA project.
Then go back and run the same macro that is causing the pop-up message to appear. The message should no longer appear.

Watin works in background

I started using WaTin as web automation tools. My target is let WaTin run their tasks, when success (such as complete sign-in) it will show the results in textbox and datagrid. My question is does WaTin can work in the background? (Not open IE every time).
Thank you.
You can hide the IE interface but it depends on the particular site you are working with. Most of the things can be done in the background but there are cases were you need to have the UI visible to calculate coordinates (like when you need to press a button inside a Flash movie) But to answer your specific question, yes Watin can work in the background. Take a look at the following method:
browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Hide);
browser is the Watin object.

Excel 2007-VBA, Right Click Buttons

I am having a strange Excel 2007 issue, and I am not quite sure how to explain this. So bear with me please....
I have created a few right click buttons to call various backend VBA functions that I have written. They were working fine earlier today, and now for some reason, a button is appearing that is not from the code in my worksheet. When you click it, it is attempting to open another worksheet and execute code from it. The two files are not in the same directory nor are they named anything similar. I deleted the file that the button is trying to execute from and now it just simply gives me an error 400.
So, I couldn’t figure that out, and have since deleted every single scrap of code in the backend of this file, and the button still appears. Any ideas what could be causing this? It seems like maybe its mixing files up or saving a copy somewhere in a temp directory and trying to access that instead of the actual code that is written in the VBA. Is there a cache I need to clear out or something?
I know I didn’t exactly do a great job describing this, so I will be more than happy to provide any and all other details that you may need. Just let me know what is going on.
EDIT #1 -- New Information ==
I can even open a new, completely blank excel file and the right click button is still there.
EDIT #2 -- Tried Diagnostics ==
I just tried running the Excel diagnostics and it found no problems. It is strange, it is like this macro has somehow became global or stored in some type of cache or something.
I hope I'm understanding your issue correctly.
If you know what right-click (context) menus the button is appearing in you should be able to fix them with a Reset command. For example if it's appearing in the Cell context menu, you could try this in the VBE's Immediate window:
Application.Commandbars("Cell").Reset
This will reset the entire menu to its default state.
Also, you might be interested in a tool I wrote, MenuRighter, that allows you to tweak your right-click menus. It also has a setting to show you the Caption and ID of any context menu.

Resources