How do I select elements within div frames? - selenium-ide

I am pretty new to Selenium IDE, hoping to use it with a certain web app which a client would like to be able to run automated tests for after periodic uplifts. The tests would all involve only clicks and text entry.
I cannot get the application to execute clicks on certain form elements on specific pages.
My test so far is simple. I am simply navigating to a page and trying to click an icon whose target, according to the IDE, is "css=#MGOpenButton-btnEl > .btn-icon". The Selenium IDE will register the click as having been performed successfully (i.e. no failures) but the actual desired output of the click (i.e. a pop-up search box appearing) isn't actually happening. I have tried click, click at, double-click, mouseover before click, all to no success.
Reading back through some other topics, I thought it may have something to do with the element being embedded in frames, but if that is the case I'm not sure how the click is being read as successful by the IDE. The second thing I'm wondering is if it might not be playing nicely with Javascript.
Is it common for the basic IDE front-end functionality to fail when a webpage incorporates Javascript?

Related

Testing ionic elements using UFT 12.02 in IE 11

I am rather new to using automated testing tools, and as a practical learning exercise, I have been trying to test a small web application using HP UFT 12.02(I updated to 12.51, but am now running into the same issue). The web app was created using the Ionic mobile development framework. I have run into a roadblock and haven't been able to find an answer or similar experience recorded anywhere.
I am not certain whether the problem I have is with UFT, the browser, or with the actual application itself.
I am using IE 11 to test the application. The UFT plugin for Firefox has been disabled at our site, and Chrome is not supposed to be installed on our machines, so I may have some awkward technical constraints.
I've tried recording my actions, and the only success I've had is using the "Insight Recording" mode. In order to make the test readable, I have to do a lot of manual inspection of the objects and renaming. Unfortunately, it seems there is a limitation to what I can select or inspect using UFT's tools.
Using the Object Spy, it seems that I can only select top-level web elements, and for the most part, it seems to work OK. But here is the blocker:
In the app, there is a form that contains a series of pop-up selectors that allow me to select a building, a floor, and a date to reserve a space on that building's floor.
Selector Screen from office reservation application
In IE, if I click the first selector (the Site), nothing happens--regardless of whether I have pop-ups blocked or not. I get the same result performing a manual test on any of those selectors outside of UFT.
If I perform a manual test in Firefox, I get an ion-alert object that contains a series of radio buttons and OK/Cancel
If I inspect the element with Object Spy, I get a "Web Element" that includes the entire contents of the
This includes the form title, all the ion-select elements and labels, etc (way too long to include in this question).
Object Spy view of the site selector object
Is it possible to select an individual element within the form without resorting to x,y coordinates on the screen or window? If so, how? I cannot guarantee who will be running the test in future, nor how their screen or browser dimensions will be set.

How to make a background macOS application?

I'm trying to develop a macOS app that performs operations on a file when the user chooses to do so. My goal is to let a user right-click a file, select my app from the list of services so that the app will pop open a UI with things like configuration options, etc.
A prime example would be Evernote's "Add to Evernote"; when a user clicks it, the Evernote app opens and saves the file there. In addition, I need to switch control to the UI, so that the user can input some settings, before performing any file operations.
The place where I'm stuck now is how to get the app/UI open when the user clicks it from the contextual menu, as well as keeping the UI hidden initially. From some googling, I think what I need to make is an agent? I'm not really sure.
Any help would be appreciated, thanks!

Mouseup event is not propagated to a popup window in IE 11

I've a legacy app that features a DND from a popup window to the main one.
It works fine in IE 8 but not in any of the newer versions of IE. The effect results in the drag ghost image being stuck in the source window and not going away after the drop had occurred.
Some debugging did in fact confirm that the 'mouseup' event does not get propagated back to the source window. What can be done to fix it? Many thanks!
ITs a bit hard to begin to answer your question without some code....
use the File>Properties menu to find out which IE security zones the two windows(domains) map too...IE uses a different security model to other browsers... drag/drop is probably not allowed between local web files (using file: protocol) and internet or intranet sites.
Have you used the Dev tool yet to debug it? If you are using showModalDialog (which normally disables context menus) you can right click on a link (a) or input element to display the context menu so you can display the debugger for showModal content page.
If possible include a link to your website or a mashup (jsfiddle) with your questions.

web submission automation: simulate onclick event on a title element to load form

A resume-service I use requires that for each listed activity on the resume, there is an hours-per-week field and total hours field. However, the total hours field does not update itself automatically no matter how many weeks pass. My goal is to write a script that does this.
The idea behind the script is:
Log in to website -> go to a certain page -> submit a form** on that page updating the total hours
**unfortunately, for the form to open, you need to click an "edit" title element first which causes it to show up. I've taken a look at the html of the webpage but cannot find the form or input tags corresponding to the form I wish to submit, only that the form is generated with what I think is a javascript function call from the element's onclick field.
I believe the relevant html snippet is:
<a title="edit" class="edit" href="#entry-type" onclick="editComponent('10227041','education');">Edit</a>
but just in case there is a much larger code snippet later in this post (check the 2nd pastebin link at the bottom)
THE QUESTION: Is there a specific language/library/way (preferably in python, although I can work with Java) to simulate an onclick event and that would result in a form loading?
I've worked on this problem a bit, starting with python's mechanize library. I wrote two functions,
def login(br,url):...
def navigate(br,baseurl,url):...
which would satisfy the first two parts of my script's plan, but the third is where the trouble starts. When I print all the forms on the page using
for form in br.forms():
print form
I get http://pastebin.com/Gxy2tc1A
The website's html can be found on http://pastebin.com/PySri5cb
Later I tried to work with Selenium (the firefox IDE plugin) and then exporting code into python, where I would edit it to satisfy my specific needs, but that was a no-go either due to some awkward errors.
Have you looked into GreaseMonkey? You should be able to use that to extract the hours per week, do the math and populate the total hours field. You could probably do the entire thing. Anything that can be done on the page in JavaScript could be done within GreaseMonkey.
EDIT: The code for that site is awful. I especially like the inline call to loadResume() that is made BEFORE the element it writes to (#build-wrap).

Pattern for Spring-MVC stateful interaction

Today I was doing this thing with Spring:
Have a page with a form and a chance to choose one item related to the form.
If you push "Choose item" the app will save somehow what you typed in the form, go to another page, let you choose the thing.
When you are back to the form it's filled with what you wrote before going to the other page, plus the item chosen.
Seems easy, but you have to take into account that for some stupid reason the user could open the page where you choose the item (maybe because of a bookmark, or because he pressed the back button 10 times to play). You know what I mean. I tried many ways, mainly based on HttpSession... I don't like any of those. None of them seems elegant. I was even thinking of using a hidden form in the other page, but given that it is not unique to this "flow" (I mean you can go to the item choose page from others as well), I will have to worry about conflicts and so on.
So what would be the preferred way for you? Suggestions?
Go around the problem instead of solving it. You can use a modal javascript div popup where the user can pick the item she wants. The contents of this div can be loaded via ajax (separate Spring MVC controller called with Http GET). Once the selection has been made, you close the popup (hide the div) and copy the value into the original form. Done.
No need to store the state anywhere.
I suggest Spring Web Flow.
Spring Web Flow compliments the Spring MVC.
Here is link to Spring Web Flow Demo