How to type in movable fields
up vote
1
down vote
favorite
I have a little problem in writing my test.
Most of fields on my website I can fill only with "type" element. But there are fields that don't want to fill. But it looks like (in Cypress) that it's OK. They are movable with arrows as shown in the image below.
When I'm in playground and I want to get that field it looks like this:
Cypress gets that field but don't want to type in it (than should element tells me that it's OK).
Code:
.cy.get('[data-bind="validationElement: yearOfManufacture"] > .col-sm-4 > .k-widget > .k-numeric-wrap > .k-formatted-value')
.type('2016')
.should('have.value', '2016')
Is there someone who knows what to do?
This is how it (DOM in dev-tools) looks like:
<input type="text" class="k-formatted-value w-100 k-input"
title="" tabindex="0" role="spinbutton" aria-valuemin="1900"
aria-valuemax="2018" autocomplete="off" aria-disabled="false"
style="display: inline-block;">
testing types automation cypress
|
show 6 more comments
up vote
1
down vote
favorite
I have a little problem in writing my test.
Most of fields on my website I can fill only with "type" element. But there are fields that don't want to fill. But it looks like (in Cypress) that it's OK. They are movable with arrows as shown in the image below.
When I'm in playground and I want to get that field it looks like this:
Cypress gets that field but don't want to type in it (than should element tells me that it's OK).
Code:
.cy.get('[data-bind="validationElement: yearOfManufacture"] > .col-sm-4 > .k-widget > .k-numeric-wrap > .k-formatted-value')
.type('2016')
.should('have.value', '2016')
Is there someone who knows what to do?
This is how it (DOM in dev-tools) looks like:
<input type="text" class="k-formatted-value w-100 k-input"
title="" tabindex="0" role="spinbutton" aria-valuemin="1900"
aria-valuemax="2018" autocomplete="off" aria-disabled="false"
style="display: inline-block;">
testing types automation cypress
If you want to click the arrows in the test, perhaps use the Selector Playground to hover over the arrows to find their selctor, then usecy.get('arrow-selector-here').click()
. But some more complex controls are difficult to select in Cypress, so it may not be possible.
– eric99
Nov 18 at 19:09
Thanks for your reply but this is not what I'm looking for. I know that I can click on that arrow but I need to fill that field with number over 40000 so that need a lot of clicks. I need to write text it in.
– Dominik Skála
Nov 19 at 8:48
Ah, I got the question back-to-front. That selector looks very complicated. Another way to find a different selector is to right-click, inspect element and see what the DOM looks like in dev tools. I typically use a class name, but it depends on the particular page. If you could post a section of DOM we can help further.
– eric99
Nov 19 at 9:15
From the class names, it looks like Kendo UI is used to make the page.
– eric99
Nov 19 at 9:17
This is how it looks like: <div class="k-animation-container" style="width: 31px; height: 24px; overflow: hidden; top: 891px; z-index: 10002; left: 565px; box-sizing: content-box; display: none; position: absolute;" aria-hidden="true"><div role="tooltip" class="k-widget k-tooltip k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute; opacity: 0;" aria-hidden="true"><div class="k-tooltip-content"><div class="z-popover-technical-card"><div class="popover-content"><img alt="Technický průkaz" src="/images/technicak-zadni.jpg"><div class="area area-vin">
– Dominik Skála
Nov 20 at 16:38
|
show 6 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a little problem in writing my test.
Most of fields on my website I can fill only with "type" element. But there are fields that don't want to fill. But it looks like (in Cypress) that it's OK. They are movable with arrows as shown in the image below.
When I'm in playground and I want to get that field it looks like this:
Cypress gets that field but don't want to type in it (than should element tells me that it's OK).
Code:
.cy.get('[data-bind="validationElement: yearOfManufacture"] > .col-sm-4 > .k-widget > .k-numeric-wrap > .k-formatted-value')
.type('2016')
.should('have.value', '2016')
Is there someone who knows what to do?
This is how it (DOM in dev-tools) looks like:
<input type="text" class="k-formatted-value w-100 k-input"
title="" tabindex="0" role="spinbutton" aria-valuemin="1900"
aria-valuemax="2018" autocomplete="off" aria-disabled="false"
style="display: inline-block;">
testing types automation cypress
I have a little problem in writing my test.
Most of fields on my website I can fill only with "type" element. But there are fields that don't want to fill. But it looks like (in Cypress) that it's OK. They are movable with arrows as shown in the image below.
When I'm in playground and I want to get that field it looks like this:
Cypress gets that field but don't want to type in it (than should element tells me that it's OK).
Code:
.cy.get('[data-bind="validationElement: yearOfManufacture"] > .col-sm-4 > .k-widget > .k-numeric-wrap > .k-formatted-value')
.type('2016')
.should('have.value', '2016')
Is there someone who knows what to do?
This is how it (DOM in dev-tools) looks like:
<input type="text" class="k-formatted-value w-100 k-input"
title="" tabindex="0" role="spinbutton" aria-valuemin="1900"
aria-valuemax="2018" autocomplete="off" aria-disabled="false"
style="display: inline-block;">
testing types automation cypress
testing types automation cypress
edited Nov 21 at 5:51
BSMP
2,48952334
2,48952334
asked Nov 18 at 12:11
Dominik Skála
87
87
If you want to click the arrows in the test, perhaps use the Selector Playground to hover over the arrows to find their selctor, then usecy.get('arrow-selector-here').click()
. But some more complex controls are difficult to select in Cypress, so it may not be possible.
– eric99
Nov 18 at 19:09
Thanks for your reply but this is not what I'm looking for. I know that I can click on that arrow but I need to fill that field with number over 40000 so that need a lot of clicks. I need to write text it in.
– Dominik Skála
Nov 19 at 8:48
Ah, I got the question back-to-front. That selector looks very complicated. Another way to find a different selector is to right-click, inspect element and see what the DOM looks like in dev tools. I typically use a class name, but it depends on the particular page. If you could post a section of DOM we can help further.
– eric99
Nov 19 at 9:15
From the class names, it looks like Kendo UI is used to make the page.
– eric99
Nov 19 at 9:17
This is how it looks like: <div class="k-animation-container" style="width: 31px; height: 24px; overflow: hidden; top: 891px; z-index: 10002; left: 565px; box-sizing: content-box; display: none; position: absolute;" aria-hidden="true"><div role="tooltip" class="k-widget k-tooltip k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute; opacity: 0;" aria-hidden="true"><div class="k-tooltip-content"><div class="z-popover-technical-card"><div class="popover-content"><img alt="Technický průkaz" src="/images/technicak-zadni.jpg"><div class="area area-vin">
– Dominik Skála
Nov 20 at 16:38
|
show 6 more comments
If you want to click the arrows in the test, perhaps use the Selector Playground to hover over the arrows to find their selctor, then usecy.get('arrow-selector-here').click()
. But some more complex controls are difficult to select in Cypress, so it may not be possible.
– eric99
Nov 18 at 19:09
Thanks for your reply but this is not what I'm looking for. I know that I can click on that arrow but I need to fill that field with number over 40000 so that need a lot of clicks. I need to write text it in.
– Dominik Skála
Nov 19 at 8:48
Ah, I got the question back-to-front. That selector looks very complicated. Another way to find a different selector is to right-click, inspect element and see what the DOM looks like in dev tools. I typically use a class name, but it depends on the particular page. If you could post a section of DOM we can help further.
– eric99
Nov 19 at 9:15
From the class names, it looks like Kendo UI is used to make the page.
– eric99
Nov 19 at 9:17
This is how it looks like: <div class="k-animation-container" style="width: 31px; height: 24px; overflow: hidden; top: 891px; z-index: 10002; left: 565px; box-sizing: content-box; display: none; position: absolute;" aria-hidden="true"><div role="tooltip" class="k-widget k-tooltip k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute; opacity: 0;" aria-hidden="true"><div class="k-tooltip-content"><div class="z-popover-technical-card"><div class="popover-content"><img alt="Technický průkaz" src="/images/technicak-zadni.jpg"><div class="area area-vin">
– Dominik Skála
Nov 20 at 16:38
If you want to click the arrows in the test, perhaps use the Selector Playground to hover over the arrows to find their selctor, then use
cy.get('arrow-selector-here').click()
. But some more complex controls are difficult to select in Cypress, so it may not be possible.– eric99
Nov 18 at 19:09
If you want to click the arrows in the test, perhaps use the Selector Playground to hover over the arrows to find their selctor, then use
cy.get('arrow-selector-here').click()
. But some more complex controls are difficult to select in Cypress, so it may not be possible.– eric99
Nov 18 at 19:09
Thanks for your reply but this is not what I'm looking for. I know that I can click on that arrow but I need to fill that field with number over 40000 so that need a lot of clicks. I need to write text it in.
– Dominik Skála
Nov 19 at 8:48
Thanks for your reply but this is not what I'm looking for. I know that I can click on that arrow but I need to fill that field with number over 40000 so that need a lot of clicks. I need to write text it in.
– Dominik Skála
Nov 19 at 8:48
Ah, I got the question back-to-front. That selector looks very complicated. Another way to find a different selector is to right-click, inspect element and see what the DOM looks like in dev tools. I typically use a class name, but it depends on the particular page. If you could post a section of DOM we can help further.
– eric99
Nov 19 at 9:15
Ah, I got the question back-to-front. That selector looks very complicated. Another way to find a different selector is to right-click, inspect element and see what the DOM looks like in dev tools. I typically use a class name, but it depends on the particular page. If you could post a section of DOM we can help further.
– eric99
Nov 19 at 9:15
From the class names, it looks like Kendo UI is used to make the page.
– eric99
Nov 19 at 9:17
From the class names, it looks like Kendo UI is used to make the page.
– eric99
Nov 19 at 9:17
This is how it looks like: <div class="k-animation-container" style="width: 31px; height: 24px; overflow: hidden; top: 891px; z-index: 10002; left: 565px; box-sizing: content-box; display: none; position: absolute;" aria-hidden="true"><div role="tooltip" class="k-widget k-tooltip k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute; opacity: 0;" aria-hidden="true"><div class="k-tooltip-content"><div class="z-popover-technical-card"><div class="popover-content"><img alt="Technický průkaz" src="/images/technicak-zadni.jpg"><div class="area area-vin">
– Dominik Skála
Nov 20 at 16:38
This is how it looks like: <div class="k-animation-container" style="width: 31px; height: 24px; overflow: hidden; top: 891px; z-index: 10002; left: 565px; box-sizing: content-box; display: none; position: absolute;" aria-hidden="true"><div role="tooltip" class="k-widget k-tooltip k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute; opacity: 0;" aria-hidden="true"><div class="k-tooltip-content"><div class="z-popover-technical-card"><div class="popover-content"><img alt="Technický průkaz" src="/images/technicak-zadni.jpg"><div class="area area-vin">
– Dominik Skála
Nov 20 at 16:38
|
show 6 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
The class names in the Playground selector indicate that this page is based on Kendo UI, so I ran a test against their demo page for numeric textbox 'https://demos.telerik.com/kendo-ui/numerictextbox/index',
It seems to me that Kendo use two inputs in DOM, one for displaying the formatted value and another for receiving the user's typed input. The second input will appear or come forward when the first gets focus.
This is the test that works for the demo page, I hope it will work for your page as well
describe('KendoUI', () => {
it('types text into numeric inputs', () => {
cy.visit('https://demos.telerik.com/kendo-ui/numerictextbox/index');
const initialValue = '$30.00'
const displayInput = cy.get(':nth-child(1) > label > .k-widget > .k-numeric-wrap > .k-formatted-value')
.should('have.value', initialValue)
.focus()
const editInput = displayInput.parent()
.children('.k-input')
.eq(1) // get the 2nd input of this parent, not the first
const newValue = '2016'
editInput
.clear()
.type(newValue)
.should('have.value', newValue)
})
})
Thank you very much!
– Dominik Skála
Nov 21 at 17:06
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The class names in the Playground selector indicate that this page is based on Kendo UI, so I ran a test against their demo page for numeric textbox 'https://demos.telerik.com/kendo-ui/numerictextbox/index',
It seems to me that Kendo use two inputs in DOM, one for displaying the formatted value and another for receiving the user's typed input. The second input will appear or come forward when the first gets focus.
This is the test that works for the demo page, I hope it will work for your page as well
describe('KendoUI', () => {
it('types text into numeric inputs', () => {
cy.visit('https://demos.telerik.com/kendo-ui/numerictextbox/index');
const initialValue = '$30.00'
const displayInput = cy.get(':nth-child(1) > label > .k-widget > .k-numeric-wrap > .k-formatted-value')
.should('have.value', initialValue)
.focus()
const editInput = displayInput.parent()
.children('.k-input')
.eq(1) // get the 2nd input of this parent, not the first
const newValue = '2016'
editInput
.clear()
.type(newValue)
.should('have.value', newValue)
})
})
Thank you very much!
– Dominik Skála
Nov 21 at 17:06
add a comment |
up vote
0
down vote
accepted
The class names in the Playground selector indicate that this page is based on Kendo UI, so I ran a test against their demo page for numeric textbox 'https://demos.telerik.com/kendo-ui/numerictextbox/index',
It seems to me that Kendo use two inputs in DOM, one for displaying the formatted value and another for receiving the user's typed input. The second input will appear or come forward when the first gets focus.
This is the test that works for the demo page, I hope it will work for your page as well
describe('KendoUI', () => {
it('types text into numeric inputs', () => {
cy.visit('https://demos.telerik.com/kendo-ui/numerictextbox/index');
const initialValue = '$30.00'
const displayInput = cy.get(':nth-child(1) > label > .k-widget > .k-numeric-wrap > .k-formatted-value')
.should('have.value', initialValue)
.focus()
const editInput = displayInput.parent()
.children('.k-input')
.eq(1) // get the 2nd input of this parent, not the first
const newValue = '2016'
editInput
.clear()
.type(newValue)
.should('have.value', newValue)
})
})
Thank you very much!
– Dominik Skála
Nov 21 at 17:06
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The class names in the Playground selector indicate that this page is based on Kendo UI, so I ran a test against their demo page for numeric textbox 'https://demos.telerik.com/kendo-ui/numerictextbox/index',
It seems to me that Kendo use two inputs in DOM, one for displaying the formatted value and another for receiving the user's typed input. The second input will appear or come forward when the first gets focus.
This is the test that works for the demo page, I hope it will work for your page as well
describe('KendoUI', () => {
it('types text into numeric inputs', () => {
cy.visit('https://demos.telerik.com/kendo-ui/numerictextbox/index');
const initialValue = '$30.00'
const displayInput = cy.get(':nth-child(1) > label > .k-widget > .k-numeric-wrap > .k-formatted-value')
.should('have.value', initialValue)
.focus()
const editInput = displayInput.parent()
.children('.k-input')
.eq(1) // get the 2nd input of this parent, not the first
const newValue = '2016'
editInput
.clear()
.type(newValue)
.should('have.value', newValue)
})
})
The class names in the Playground selector indicate that this page is based on Kendo UI, so I ran a test against their demo page for numeric textbox 'https://demos.telerik.com/kendo-ui/numerictextbox/index',
It seems to me that Kendo use two inputs in DOM, one for displaying the formatted value and another for receiving the user's typed input. The second input will appear or come forward when the first gets focus.
This is the test that works for the demo page, I hope it will work for your page as well
describe('KendoUI', () => {
it('types text into numeric inputs', () => {
cy.visit('https://demos.telerik.com/kendo-ui/numerictextbox/index');
const initialValue = '$30.00'
const displayInput = cy.get(':nth-child(1) > label > .k-widget > .k-numeric-wrap > .k-formatted-value')
.should('have.value', initialValue)
.focus()
const editInput = displayInput.parent()
.children('.k-input')
.eq(1) // get the 2nd input of this parent, not the first
const newValue = '2016'
editInput
.clear()
.type(newValue)
.should('have.value', newValue)
})
})
answered Nov 21 at 7:54
eric99
253210
253210
Thank you very much!
– Dominik Skála
Nov 21 at 17:06
add a comment |
Thank you very much!
– Dominik Skála
Nov 21 at 17:06
Thank you very much!
– Dominik Skála
Nov 21 at 17:06
Thank you very much!
– Dominik Skála
Nov 21 at 17:06
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53360714%2fhow-to-type-in-movable-fields%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If you want to click the arrows in the test, perhaps use the Selector Playground to hover over the arrows to find their selctor, then use
cy.get('arrow-selector-here').click()
. But some more complex controls are difficult to select in Cypress, so it may not be possible.– eric99
Nov 18 at 19:09
Thanks for your reply but this is not what I'm looking for. I know that I can click on that arrow but I need to fill that field with number over 40000 so that need a lot of clicks. I need to write text it in.
– Dominik Skála
Nov 19 at 8:48
Ah, I got the question back-to-front. That selector looks very complicated. Another way to find a different selector is to right-click, inspect element and see what the DOM looks like in dev tools. I typically use a class name, but it depends on the particular page. If you could post a section of DOM we can help further.
– eric99
Nov 19 at 9:15
From the class names, it looks like Kendo UI is used to make the page.
– eric99
Nov 19 at 9:17
This is how it looks like: <div class="k-animation-container" style="width: 31px; height: 24px; overflow: hidden; top: 891px; z-index: 10002; left: 565px; box-sizing: content-box; display: none; position: absolute;" aria-hidden="true"><div role="tooltip" class="k-widget k-tooltip k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute; opacity: 0;" aria-hidden="true"><div class="k-tooltip-content"><div class="z-popover-technical-card"><div class="popover-content"><img alt="Technický průkaz" src="/images/technicak-zadni.jpg"><div class="area area-vin">
– Dominik Skála
Nov 20 at 16:38