protractor dragAndDrop not working on Mac - macos

I am executing my protractor code on MAC OS system and using Chrome. Everything works but not drag and drop event.
The code is working fine if I put my actual mouse position on the target of drop. But if the actual mouse position is not at the target location, its not performing the action.
The code I am using is as:
browser.actions().dragAndDrop(source,target).perform();
I have also tried this :
browser.actions().mouseDown(source).mouseMove(target).mouseUp().perform();

Use html-dnd NPM module.
Link:https://www.npmjs.com/package/html-dnd
code snippet:
var dragAndDrop = require('html-dnd').code;
var draggable = driver.findElement(By.id('draggable'));
var droppable = driver.findElement(By.id('droppable'));
driver.executeScript(dragAndDrop, draggable, droppable);

for this :
browser.actions().dragAndDrop(source,target).perform();
try this :
browser.actions().mouseMove(source).mouseDown().mouseMove(target).mouseUp().perform();
Note that dragAndDrop is nothing but mouseMove + mouseDown + mouseMove + mouseUp

Chances are you're in a long line of people who have problems with the drag and drop functionality implemented with html5. This has been a problem area to work around using Selenium webdriver.
Please see that the issue might be due to an age old bug that was filed for ChromeDriver.
The bug has a lot of discussion that may be helpful in understanding the real issue and there are also a lot of solutions mentioned in the comments below - however there has not been a fool-proof or 100% working solution to this problem.
This bug has been mentioned in Protractor github issues a lot of times like here, here, here,and here and in Selenium GitHub in the archived issues here.
One of the solutions you can try is this helper method that was created here. However this is not a guaranteed solution, but I would suggest you to give it a try. The original issue mentioned for Protractor here also has many other solutions mentioned which you can try. You can also try this helper method.
Also, please see that the same question has been posted multiple times here, here, here, here.

Related

CKEditor 4.7.3 not utilizing custom config file any more

I am hoping someone can help me. I have been using CKEditor for years on my production site, ever since FCKEditor, and it has been working very well until recently. I have customized my toolbar and added custom addons and customized the filebrowser and they have been working for a long time. My config file is sitting in a subdirectory but CKEditor just does not want to show the customizations for me, it just shows the FULL toolbar with standard colors etc. Has anyone else noticed this behavior? Is there some fix I cannot seem to find for this? My CKEditor call is below. The odd thing is my dev server and my dev box have no issues with this and ckeditor works just like it should. Any help would be greatly appreciated!
CKEDITOR.replace('ctl00_ContentPlaceHolder1_fckTemplateEditor', {
customConfig: 'ckeditor/myconfig.js'
, filebrowserBrowseUrl: 'ckeditor/filemanager.aspx?window=' + window.name,
filebrowserImageBrowseUrl: 'ckeditor/filemanager.aspx?window=' + window.name,
filebrowserWindowWidth: '780',
filebrowserWindowHeight: '650'
}, {
removePlugins: 'elementspath',
extraPlugins: 'uicolor',
height: '800px',
});
CKEDITOR.config.height = 450;
Ok after trying everything I could find, I figured it out. It seemed it was attaching to the control prior to my replace call so it was giving me an already attached error in the console, which I was not watching for. so I needed to destroy that attachment with the following code and it started to work again. There must be some issue with new browsers and how they work that is causing it to act up and just thought I would share what I found after a day of searching.
if (CKEDITOR.instances["ctl00_ContentPlaceHolder1_fckTemplateEditor"]) { // Check null
CKEDITOR.instances["ctl00_ContentPlaceHolder1_fckTemplateEditor"].destroy();
}
Thanks

Nativescript addSubview

I'm trying to implement the OpenTok SDK into Nativescript and I've run into an issue that I can't seem to wrap my head around.
Per their documentation (https://tokbox.com/developer/guides/publish-stream/ios/#create_publisher) once you create a publisher object you call:
[self.view addSubview:publisher.view];
I can't figure out how I would tie this into Nativescript, if it's even possible.
My first thought is that I would want a UIView or View element on my page in the XML, then I would call .addView(publisher.view); on that element.
There is a similar question here (Inject pure Java / Obj-C code in NativeScript App) but nothing came of it, the one answer does't provide much help.
I cloned one of OpenTok's sample projects and added their implementation of this call into a gist here: https://gist.github.com/bondydaa/2db355ed45b7e50e4071
You can see at line 117 how they implemented this call. This code raises another question for me in that I'm not sure where _publisherView comes from.
Any help would be greatly appreciated!
In Nativescript you can try calling the 'ios' property of the container you are trying to add the component to. This will return the native object.
For example if you have a StackLayout, you can:
var stackLayout = args.object.getViewById("theIdOfTheStackLayout");
stackLayout.ios.addSubview(publisher.view);

Firefox "Mouseover" issues in Selenium Ruby bindings on Windows

I've been struggling with mouse hover for a couple of days and found a couple of threads here on the topic, but none have helped. I've tried dozens of different approaches and have also modified my code to be more in sync with the examples here, especially Dave Haeffner's suggestions. The current code looks like:
Selenium::WebDriver::Wait.new(timeout: 2).until do
#driver.find_element(link: "ADMIN").displayed?
end
#driver.action.move_to(#driver.find_element(link: "ADMIN")).perform
Selenium::WebDriver::Wait.new(timeout: 2).until do
#driver.find_element(link: "ORGANIZATION").displayed?
end
driver.action.move_to(#driver.find_element(link: "ORGANIZATION")).perform
Selenium::WebDriver::Wait.new(timeout: 2).until do
#driver.find_element(link: "TEAMS").displayed?
end
#driver.find_element(link: "TEAMS").click
end
On macs, this code works fine. On Windows however, it produces:
Failure/Error: #driver.action.move_to(#driver.find_element(link: "ADMIN")).perform
Selenium::WebDriver::Error::InvalidElementStateError:
Cannot perform native interaction: Could not load native events component.
I'm sure the element access is fine, because if I change the first mouse hover to a click action, it works great.
Any help would be appreciated.
You need to use Firefox version 31.0.6 . Versions of Firefox after that don't have the native events support. If you need to use a later version of Firefox, then just make sure your test actions are all non-native, such as using a JavascriptExecutor to create a hover (instead of relying on native events in the firefox driver).

Unable to scroll down

I'm struggling on my website which worked well since the shareaholic widget install. I've tried to remove it but the bug remains.
A picture is worth thousand words so it's about : www.mywebshop.org, we can't scroll anymore on the website and I must admit I've never seen that bug (except when using fixed position ;-)).
I'm totally stuck... no cache is active, I can't see anything out of the ordinary... I'm having this issue on every browser on my mac.
Any clues?
Thank in advance ;-)
hey there I have seen your site. Please remove the overflow-y:hidden; from the body selector in the style.css file on line number:2793
That should do it

EF 4.0 - Save creates duplicates in TEST environment, but not in DEV

FINAL EDIT If you are looking at this question, please see the answer I posted below. The original problem was not with EF, it was with my JQuery implementation.
EDIT: I have confirmed that this is only happening in IE (specifically IE 7). I don't see the same behavior in Chrome. I haven't tested Firefox yet, but we don't support FF in our environment, so I'm not as worried about it.)
Before I post a bunch of code, I just wanted to put this out there to see if anyone else has ever experienced anything similar, and if so, what their culprit was.
I have code in an MVC project that creates a new entity. The code works as expected in my local environment. However, when I push the code out to our test server environment, the same code creates two records upon save.
I have verified that the database schemas are identical, so I have eliminated that as a possible cause.
Has anyone else ever experienced anything like this? If so, what did you do to fix the problem?
Thanks
I finally tracked the issue down to a bug in some javascript. The problem had nothing to do with Entity Framework or MVC. I have some jQuery code that helps me add icons to submit buttons, and in IE it was causing the submit to happen twice.
In case anyone is interested, here is the offending code:
$('input[type="submit"]').each(function () {
$(this).hide().after('<button>').next().button({
icons: { primary: $(this).attr('icon') },
label: $(this).val()
}).click(function (event) {
event.preventDefault();
$(this).prev().click();
return false;
});
});
This caused no problems in Chrome, but in IE the submit buttons were firing twice. To fix it, i added onclick="return false;" to my input tags, and the problem went away.

Resources