Web browser hangs upon Drag And Drop Keyword for robot framework - drag-and-drop

I am currently using Robot Framework to automate my test cases. In one of the test cases I have, I need to drag and drop a certain element. Upon using the SeleniumLibrary keyword Drag And Drop, my browser just hangs. Has anyone encountered this same error? Is there a work around I can use?
I am using Robot Framework 2.7 and running my tests on IE8 and FF9.
Here is sample code:
Wait Until Keyword Succeeds 10s 5s Element Should Be Visible
//td[#class='policy_td']//ul[#class='workgroup_list']
Drag And Drop //ul[#id='unused_workgroup_ul']//li[#class='workgroup']//span//span[text()='Test'] target=//td[#class='policy_td']//ul[#class='workgroup_list']

I had the same problem today. You should define element by locator using xpath, and later use it as the target. For example, part of your code could look like:
Assign Id To Element xpath=//td[#class='policy_td']//ul[#class='workgroup_list'] ID
Drag And Drop //ul[#id='unused_workgroup_ul']//li[#class='workgroup']//span//span[text()='Test'] target=ID

Related

Not able to handle special characters for mobile app element locator using robot framework and appium

I am trying to test a mobile app using robot framework, appium and eclipse as IDE. My app login has to be clicked using the elements class and content-desc but when I copy the content-desc I notice a special character (Log In) which doesn't get saved in eclipse.
Please help me to find the x path using login or even without it.
PFA the screenshot of the elements at https://i.stack.imgur.com/XE3pg.png
In my case, special character was coming due to the icon associated with the text.
For Appium, it's better to use accessibility ids for finding the elements.
Hope this helps :)

Export/Importing Expression Engine Entries

I'm currently building an Expression Engine site and have got to the stage when I would like to put it on a staging area for the client to see and start adding content too. However, if he starts adding content I'm not sure how to copy that over to my dev area before I do another update. I've had a look round for some import/export plugins but there doesn't seem to be a simple way to do it, the best way I've seen so far is to export it using a statement within this plugin:
http://brandnewbox.co.uk/products/details/export
And import it again using this plugin:
http://brandnewbox.co.uk/products/details/datagrab
Is there a better way?
Nope. That's the only way -- major failing of ExpressionEngine. Control panel used to have an export option built in under 'Tools', but it was removed for reasons unknown!

Stopping Ember.js Controller

My question is very basic on one hand but on the other hand the general situation is more complex, plus I cannot really get any working sample.
I'm developing/maintaing a web-application which is currently in transition from GWT code base into Ember.js.
Most of the newer code already relies on Ember.js and I think it's really awesome.
The problem is we cannot use Ember Router as all the request are being handled by the GWT.
In order to enabled the application run in this unusual configuration we have special JavaScript files that create our Ember main objects (Controllers & Models) for us.
As you can imagine navigation between tabs is cumbersome and is handled by GWT who creates Ember objects when needed. We are in transit toward a brave new world Ember Router and all.
But in the meantime, this is the problem I'm facing right now.
The user clicks a link which opens a page that contains some Ember based table.
The data is retrieved form the server using some Ajax code. Upon success it spawns a forEach loop which tries to pushObject all the received date into our Ember based components.
My problem happens when the user quickly switches between tabs. In this case the first list of object has not finished rendering yet and suddenly there's a new set of objects to handle. This causes Ember to throw errors like:
"Uncaught Error: Cannot perform operations on a Metamorph that is not in the DOM. "
and
"Uncaught NotFoundError: An attempt was made to reference a Node in a context where it does not exist."
Is it possible to prevent the loop from trying to render?
I've tried checking if the controller in question is already inDOM and it is, is there a way to notify Ember this object is no longer valid?
Sorry for a lengthy question and lack of running sample.
I'd probably modify the switch tab code to only execute afterRender has completed, that way you aren't mucking with ember objects while they are being used.
Ember.run.scheduleOnce('afterRender', this, function(){
// call GWT switch tab routine
});
Thank you Daniel and Márcio Rodrigues Correa Júnior. eventually what I did is to add a patch that would check the current context of the application (in my case the currently selected tab). If upon receiving the AJAX response the application is in the correct context (meaning the user haven't change the tab) go on. Otherwise just ignore the response and do not try to render it.
Now it seems to be working

How to remove id location strategy from Selenium IDE

the problem is: my web application uses ZK, which automatically generates random UUID for each web element.
When I try to record some basic test-case with Selenium IDE, it automatically tries to use these randomly-generated ID's, without even giving me a good alternative.
Is there a way to forbid Selenium IDE to use IDs while locating elements?
Possible workaraounds:
Implement ID generator in ZK: I've thrown away this possibility, because the application GUI is too complex for this task, and ID should be unique for whole sesion, which make this workaraound really hard to implement, when you have same elements on different page.
Find another recording tool: I've only found XLT script developer, which does the work by writing DOM-path using classes (which zk gives plenty) - but sometimes the location strategy gives false path, which is then not reproducible. Any good alternatives here?
You can change locater builder by changing the order of the locater in options>locater builder.
For example if you want to give first preference to css: name drag it on the top so when you start recording it will first give the preference to css name
Hope this will help you

WatiN SelectList Methods - Page not refreshing/actions not being fired after interacting with a select list

Preface:
If you don't care about the preface, skip down to the section marked "Question."
Hi,
Recently my company has upgraded to the latest version of WatiN for its test automation framework. We upgraded to avoid a problem where interacting with a select list would cause an ACCSES DENIED error. This error seems to be a product of the fact that our web application reloads the page it is on (which sits in a frame which sits in a frameset) with new fields after certain select lists options are selected. It could also be that our framework, which wraps around WatiN, often does actions on the same SelectList after the page refresh (I'm still looking into this, I'm new to the framework).
The new version of WatiN does solve the ACCESS DENIED error, but also seems to stop select lists from firing the action that causes the page to reload w/ its new options. In fact, if you use WatiN to make the selection, the select list won't work correctly, even if manually interacted with, until the page has been forced to refresh.
Question:
When selecting an option in a SelectList using the newest WatiN code, the event that causes our web app's page to reload with new fields/values does not execute. What are some possibilities that could cause this?
The term i've seen used most often to describe the refreshing that occurs when our select lists are used is "double post-back".
Many thanks,
Chad
This is part of the new WatiN code. The new code, if you look into the SelectList class has comments about the fact that it has been changed so that these events don't exactly fire. It says something along the lines of "you may need to use a key press or other event to get a select list to fire its events".
This didn't work for me so we went back to the old code.
One thing that has helped is wrapping calls to the select list w/ a try/catch(System.UnauthorizedAccess e) and then doing a .Refresh on the select list object. Afterwards, the call can be retried and it seems to work pretty well.