Webdriverio 6 - How to right click at X and Y location - webdriver-io

Webdriverio 6 - How to rightclick at X and Y location.
Could not find the rightclick command in WebdriverIO version 6 docs.
this is the code showing in WebdrivewrIO v4 but not working in V6
browser.rightClick(elementXpath,5,184);
Error showign is
rightClick is not a function
Is there a way to right click in WebdriverIO V6. Please help.

The best option is to start with reading docs, in this case see click command usage https://webdriver.io/docs/api/element/click.html#usage
According to the docs you can pass x, y, and button.

In API v6 you can pass the button you want to click (left||right||middle). For your use case above it would look like the following.
$(selector).click({ "right", 5, 184 })
Their v6 API docs can be found here: https://v6.webdriver.io/docs/api.html

Related

Error : No repository found at http://rlogiacco.github.com/Natural

Currently I am using Eclipse for Java Developers 2020-12 and while trying to install Natural 0.9 plugin I am encountering an error which is "No repository found at http://rlogiacco.github.com/Natural".
Can someone suggest what should be done to rectify this ?
The below worked successfully for me. Hope it works for you too.
From the Eclipse "Help" menu, open "Install New Software..." Add a new site: Button "Add... " in the upper right Enter
Name - Natural
Location - http://rlogiacco.github.io/Natural
Note: Make sure there are no spaces in the Location field value
From the Eclipse "Help" menu, open "Install New Software..."
Add a new site: Button "Add... " in the upper right
Enter Name: "Natural", Location: "http ://rlogiacco.github.io/ Natural" (the correct link, remove blanks)
Click "Add", select what you want to install, and install.
Open Eclips--> Help-->InstallNewSoftware-->Click on Add button-->Enter Name:"Natural"-->Location= https://rlogiacco.github.io/Natural [ Space should not be there]-->Click on Add and and follow Instruction.
This solution is work for me.Refe attached successful Natural plugins installation snap.
enter image description here
Worked for me:-
Go to Help > Install new software > Add > Give it a name "Natural" > Add http://rlogiacco.github.io/Natural

Key.ENTER on an input does not submit

I'm trying out Karate and have a use case where I need to trigger a search in a search box and there is no button to trigger the search, so it needs to be triggered via the enter key.
I have tried multiple different flavours of trying to provide Key.ENTER to the input to get it to work but none of them triggers it.
I am using the latest binary with a very basic feature file (altered to use google rather than an internal app URL):
Feature: Trigger search with enter
Background:
* configure driver = { type: 'chrome'}
Scenario: Trigger Google search with enter
Given driver 'https://google.com'
# 1: Attempting to search with enter as an array argument
When input('input[name=q]', ['karate dsl', Key.ENTER])
# 2: Attempting to search with enter as a second command
#When input('input[name=q]', 'karate dsl')
#When input('input[name=q]', Key.ENTER)
# 3: Attempting to search using similar approach to 1 but with a submit
#When submit().input('input[name=q]', ['karate dsl', Key.ENTER])
Then waitFor('{h3}intuit/karate: Test Automation Made Simple - GitHub')
When using any of these approaches (by running ./karate <PATH_TO_ABOVE_FEATURE_FILE>) the search results page never loads so the result (the h3) can never be found...what am I doing wrong?
This is a bug for type chrome. It will actually work for type chromedriver.
Opened an issue: https://github.com/intuit/karate/issues/1192
For now please workaround by using a click on the appropriate button / control etc.

Unable to differentiate between note and message in Odoo 12

When I log any note (after clicking log note link) inside sale-> quotations or CRM -> activity
After entering any note when I check in notification section is doesn't show 'Note By ...' label in Odoo 12, in Odoo 11 it works fine.
I debugged the code and found that there is problem in the base module
mail->static->src->js->models->messages->abstract_message.js -> isNote()
function is returning NULL!
Please tell me is it a bug or how to differentiate between message and note.
Thank you!
Screen Shot - 1(Odoo 12)
Screen Shot - 2 (Odoo 11)
You can differentiate notes from messages by the background color of the notification:
To distinguish a note in code, you have to use the internal field of the message's subtype_id:
is_note = message.subtype_id.internal

Nightwatch.js: Drag and Drop

I am trying to test a drag and drop operation using Nightwatch.js 0.8.18, Selenium Server 2.53.0 and Chrome Driver 2.21.2.
Basically, I take the approach described at https://github.com/RobK/nightwatchjs-drag-n-drop-example/blob/master/spec/drag-and-drop.js – i.e.: something like ...
.moveToElement('some-xpath-expression', 10, 10)
.pause(100)
.mouseButtonDown(0)
.pause(100)
.moveToElement('other-xpath-expression', 30, 30)
.pause(100)
.mouseButtonUp(0)
The cursor moves to the element to be dragged (perceivable by the :hover style of the icon the mouse is over), but then nothing happens. It looks to me like the mouseButtonDown() action has no effect. (But who knows for sure?)
It makes no difference if I use Firefox instead of Chrome – the behavior is exactly the same.
Any ideas?
Guys you have to try this and it works fine in Chrome, Firefox and IE.
Just you have to install "html-dnd" using npm, as well as this is a link: https://www.npmjs.com/package/html-dnd
After installing you just have to execute this command
browser.execute(dragAndDrop, ['#draggable', '#droppable']);
For Example:
var dragAndDrop = require('html-dnd').codeForSelectors;
browser.execute(dragAndDrop,['#elemendId1','#elemendId2']).pause(2000);
Hope this will work fine for your test cases.
The moment you click the element the expression changes and thus the tests 'forgets' what they were supposed to be clicking.
It's recommended to use an action build approach as so:
http://elementalselenium.com/tips/39-drag-and-drop
Currently at Nightwatch Version 1.5.1 I'm able to drag and drop with the following example.
Example:
"Step 1: Drag and Drop": function (browser) {
browser.moveToElement('yourLocator', '#startingElement', 0, 0);
browser.mouseButtonDown(0);
browser.moveToElement('yourLocator', '#endingElement', 0, 0);
browser.mouseButtonUp(0);
}

Selenium IDE: this.browserbot.getUserWindow().typeList.filter returns error on IE8

I have faced with following trouble during working with Selenium.
I need to verify that some value exists in list and I use the following code:
assertEval
this.browserbot.getUserWindow().typeList.filter(function(v) { return v[0] === 'Type_${r_suffix}'; })[0][0];
Type_${r_suffix}
This works file on Firefox, but on IE 8 returns error: Object doesn't support this property or method.
Could someone have an idea where is a problem?
As the MDN docs say, the filter() method is available only for IE9 and above.
Your're just using a too new technology. Filter it manually using a for loop or insert the code for Array.prototype.filter (from the MDN) to have access to it.