coded ui the controls become blocked (hidden) after new page loads - coded-ui-tests

The controls in the page become blocked (hidden) after the new page loads. Error message :
Test method GUIAutomation.CodedUITest1.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException: Cannot perform 'Click' on the hidden control.

The root cause of this issue is: coded UI store the previous parameters of the window. When appeared the new window. Coded UI must have new search criteria for this new window. If the window have the same of search criteria. You must create the new instance of the window in coded UI.
Example:
SystemMessagePage message = new SystemMessagePage();
message.CloseExistMessage(); \\Close system message
If appeared the new system message window, we can't close this window by call of the method message.CloseExistMessage();.
To close a new system message window we must create a new instance of the window and repeat the previous code.
SystemMessagePage message = new SystemMessagePage();
message.CloseExistMessage(); \\Close system message

Related

How Receiving WM_Notify in win32 python

I want to get notification to my Form or Dialog handle that one of the control(Ex Button) got its state changed by performing some action(Ex Selecting an Item from combobox) in the same Form or Dialog
I have tried to implement on_notify, but for some reason Its not getting called on occurrence of any event change in the form or Dialog
I need to get on_notify method to be called on any kind of style or state changed in my Dialog or form and also find which control sent the notification to the Toplevel dialog

Can not select an item from WinList in codedui

I am doing automation for a desktop winform application and I want to select from a combobox , I dont know why but is recognized as a WinList instead of a standard combobox. codedui opens the list by clicking the button near it but can not select an item, getting error for it.
Here is the recorded code for the UI element
WinButton uIOpenButton = this.UIProMANAGEWindow.UIProductionReportWindow.UICbReportComboBox.UIOpenButton;
WinList uIItemList = this.UIItemWindow.UIItemClient.UIItemList;
#endregion
// Click 'Open' button
Mouse.Click(uIOpenButton, new Point(9, 9));
// Select '' in list box
uIItemList.SelectedItemsAsString = this.URFSelectReportParams.UIItemListSelectedItemsAsString;
Here is the exception I am getting
Message: Test method CodedUITestProject2.Raporlar_URF1.CodedUITestMethod1 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnBlockedControlException: Another control is blocking the control. Please make the blocked control visible and retry the action. Additional Details: TechnologyName: 'MSAA'ControlType: 'List' ---> System.Runtime.InteropServices.COMException: HRESULT özel durum döndürdü: 0xF004F003
After the WinList opens ,you need to check the properties of the control that opens. It might most certainly be Wincustom and in it there would be WinListItem.
You have to create these controls and then click the Winlistitem you want using Mouse.Click().

ZK: Modal window not working properly when exception is thrown

The problem I have is pictured in this fiddle I created:
If you click on the Order coffee button, I've forced a Runtime Exception to be thrown within the doAfterCompose method of the modal window's controller. As you can see the modal window gets appended at the bottom of the page. This, aside from being ugly, allows the user to click again the Order Cofee button, which causes the famous "Not unique ID in space" error.
Is there any way to prevent the window from being created when an Exception is thrown?
You can call setPage(null) method on your component.

How to make popUp not submit form on startup?

I am using JDeveloper 11.1.2.3.0,
I have a createInsert button that has ShowPopUp Behavior operation included. In the popUp I have inserted a form whose attributes will be clean from the createInsert operation. When I click the button the popUp shows up all right but showing an error about the mandatory fields of the form. The fields of the form of course are empty because I just opened it. So I think that the popUp is autoSubmiting the form at the starting point.
Does anyone have an idea how to stop it from doing this?
I have changed the createInsert button PartialSubmit property to false but nothing changed.
Ok found the solution. The popUp was not submitting anything actually but during the CreateInsert operation the iterator opens a new row in every related component within that page (form, table etc). So when my popUp opened up with the new form fields, a new row was being created in the back-stage in my read-only table. I changed the iterator in a new one from another Application Module for each case and everything is fine now.

Open and pass data to a popup (new tab) from content script

I'm writing a chrome extension and have a question.
My extension has some .html page in it, let it be 'popup.html'. I inject a content script into some page and this script opens a 'popup.html' in a new tab with something like 'var p = window.open(chrome.extension.getURL('/popup.html'), "popup")', which works perfectly. Next, I need to pass some data to this window and I can't figure how to do it in a simple way.
For some reason I can't call child window's function from a content script with
var p = window.open(chrome.extension.getURL('/popup.html'), "popup");
p.foo(data);
In the console I see Uncaught TypeError: Cannot call method 'foo' of undefined message.
I can't pass data in a query string, because the data is simply too big.
Is there an elegant and simple way to pass data to such kind of window? I thought about messaging, but how do I effectively get tab ID of a newly opened window w/out using a background page?
Thanks a lot in advance.
UPD:
I tried to inverse the logic and get a data from parent window with 'window.opener.foo()' but in a newly opened tab window.opener returns null.
Ok, I found two solutions to my problem.
1) Add a background page, which opens a popup with chrome.tabs.create(). Then send a message from a content script to a background page, which re-sends it to a corresponding tab via chrome.tabs.sendMessage(). It looks a little ugly, but works.
2) A better one, w/out background page. Extension (popup) page creates a listener for long-lived connection. Then content script sends a message to this connection. A problem here is that a listener is not created right after the page is opened, so there should be a mechanism for a content script to wait until popup is loaded. It can be a simple setTimeout or a notification from popup via same long-lived connection.
If anyone has a better solution I'd gladly check it out as well.

Resources