Issues : Selenium Automation on MSCRM2011 - xpath

I am doing Selenium Automation testing On MSCRM 2011 but Save,Save&Cloase Buttons are not performing the Action
After filling (Child frame)the details in Fields(Attribute) i am switching to Parent frame . IS there any Issue with Ribbon Button in MSCRM2011

Try to simulate a mouse event to perform the click operation. This could help you.

Related

Is it possible to launch the taskpane if certain conditions are met?

I want the user to press on a command button which will run an API. If the API returns results, I want this to launch the taskpane and then display the result of the API.
Is this possible?
If we speak about web add-ins the task pane is launched by the button click independently of API results. At runtime you may decided what to display on the task pane.
But if you mean a custom task pane as a part of COM add-in you can do whatever you like - hide, show and etc.
For web add-ins, launching a task pane after running some code/API is not possible today. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.
Here are two alternatives I would suggest considering to see if they can work for your scenario
adding a command with ExecuteFunction as an action https://learn.microsoft.com/en-us/office/dev/add-ins/reference/manifest/functionfile and launching a dialog (displayDialogAsync)
Or, run ExecuteFunction that adds notification message with an action link that user can click to open a taskpane https://learn.microsoft.com/en-us/javascript/api/outlook/office.notificationmessageaction?view=outlook-js-preview

Handle Webpage dialog box in selenium

I am automating an web application through selenium, in that application on click of Search button a web page dialog box appears.
This dialog box is not identified by developer tool, developer tools still identifies parent window.
Driver.getwindowhandles is returning count of 1, which looks like the dialogbox is not a child window.
Tried Alert, frames, iframes but none them has identifed this dialog box.
Also this popup is not a window pop up.
Can someone please suggest how to handle this kind of webpage dialog box.
This is a nightly job, so i cannot use Robot class , AutoIT or sikuli because these require an active window session.

Can't find out how button click event got wired

I have a button which posts back through Ajax. I tried to find out what code executes when the button is clicked. I used Visual Event (screen capture below) to see how the event was bound but the info didn't help me enough. Then I set an event listener breakpoint on mouse clicks in Chrome. The breakpoint hit code in the main jQuery file which was also not helpful. So I blackboxed the file. Now when I click the button, no breakpoints are hit.
What's a systematic way to find the user code which gets executed? I also searched for 'live' and 'click' as text across the whole app. It was time consuming and didn't find where the click event for the button got attached. It's painful to do such a search. I would like to know the productive technique using Chrome's debugger or another tool. (Another browser's tips are OK)
Have you tried the Chrome profiler?
Launch the Chrome DevTools (F12)
Go to the Profiles panel
Ensure that Collect JavaScript CPU Profile is selected
Click Start
Perform your operation
Click Stop.
Then you should see a list of functions that were called.
There are several possible ways to do so. One is described by the user thesentiment. Another way is to use the DevTools' debugger.
Open the Chrome DevTools (F12)
Switch to the Sources panel
Click the Pause button () or hit F8
Perform your operation
=> The script execution will stop at the first line of the event handler function within jQuery. You can then step through to your actual event handling function.
Note that in Firebug this works much easier, because its Events side panel already displays the wrapped listeners, i.e. the functions that are called by a jQuery event listener:

TestComplete moving Focus

I'm getting stuck on this problem where when I click the 'Select Product' button a window will appear, (the previous window gets disabled until I add a product) and in it I have to select an item in that window and click the ADD button.
The problem is when TestComplete clicks the 'Select Product' the new window opens (and the old window is disabled until the product is added) and the Testcomplete focus is not moving to that new window.
I don't know how to do that, can you guys help me on it?
I think that you are facing a deadlock: TestComplete waits until the action invoked by the button pressing is completed while it cannot be completely until TestComplete closes the new window. To avoid the deadlock, you need to call the ClickButton method asynchronously. You can find information on how to do this in the Calling Methods Asynchronously help topic.
If you are coding with JScript do a
NameMapping.Sys.TestedApplication.RefreshMappingInfo();
This helped in my case accessing controls in a dialog.

Multiple Instances of Firefox during Selenium Webdriver Testing not handling focus correctly.

I have noticed that while running multiple selenium firefox tests in parallel on a grid that the focus event handling is not working correctly. I have confirmed that when each of my tests is run individually and given focus of the OS the tests pass 100% of the time. I have also run the tests in parallel on the grid with Chrome and not seen the issue present.
I have found the following thread on google groups which suggests launching each browser in a separate instance of xvfb may be a viable solution.
https://groups.google.com/forum/?fromgroups#!topic/selenium-developers/1cAmsYCp2ho%5B1-25%5D
The portion of the test is failing is due to a jquery date picker which is used in the project. The date picker launches on a focus event and since there are multiple selenium tests executing at the same time the webdriver test executes the .click() command but focus does not remain long enough for the date picker widget to appear.
.focus(function(){ $input.trigger("focus"); });
jQuery timepicker addon
By: Trent Richardson [http://trentrichardson.com]
My question is if anyone has seen this before and solved it through some firefox profile settings. I have tried loading the following property which had no affect on the issue.
profile.setAlwaysLoadNoFocusLib(true);
The test fails in the same way as it did before with that property enabled and loaded in the Remote Driver Firefox Profile.
I need a way ensure the focus event is triggered 100% of the time or to solve the issue of multiple firefox browsers competing for focus. Considering Chrome displays none of these issues I wonder if it may also be considered a bug in firefox.
Thanks!
#djangofan: Wrong. You cannot lock the focus. After you requested focus in one window and before you trigger an action, another window requests focus, and your action (like sending keys to input field) just doesn't work. This happened in our tests several times daily. It was hard to reproduce, because with each test run it failed on different places. A solution is to execute each browser in a separate display. E.g. you can use Xvfb:
Xvfb ... -screen 1 1200x800x24 -screen 2 1200x800x24 ...
Then when you start a browser, assign a separate screen to it:
browser.setEnvironmentProperty("DISPLAY", ":N.1");
browser.setEnvironmentProperty("DISPLAY", ":N.2");
...
I've had the same issue in my continuous integration environment with Jenkins.
After a long research i found an old bug in firefox that led to a new config flag to avoid those problems.
The solution is to enable this flag on the firefox profile that the tests use. The flag is focusmanager.testmode, set it to true.
The explanation is that the focus events are triggered only when firefox window is active. If you run multiple test you have multiple windows so only the active one triggers the focus events. With this param the events are trigered even for non active windows.
You can wrangle this and get it under your control with no problem. First write a method to identify the popup window by its window handle id. Then, use a JavaScriptExecutor to execute "window.focus()" in javascript to force the window to be focused just before you perform another action. Then, you can close the popup by its window handle name if necessary.

Resources