Some commands do not appear to work in NW2 which were working in NW1.7 #3107
Unanswered
pholland-hbc
asked this question in
Help Needed
Replies: 1 comment
-
@beatfactor Are you aware of these issues? Are they likely to be fixed in future releases? Or, am I doing something wrong and they are not really issues. |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I am porting some code from NW1.7 to NW2.0.10 (latest release as of this post, to my knowledge). I have seen that there are some browser commands that do not appear to be working - or at least are working differently between releases.
this.client.getLocationInView("div.navbar-header.brand a.logo-home");
In NW1.7 this command scrolls the window back up to the top of the page - where the element is located. In NW2.0 the window remains at the bottom and does not bring the element "into view". Thus the next command cannot click on the desired element as it is off the top of the page. I get this error message:
Error while running .clickElement() protocol action: element click intercepted: Element <select name="sort-order" class="custom-select-field form-control select-sort-order" aria-label="Sort By" aria-describedby="sort-order" style="width: 147.494px;">...</select> is not clickable at point (1468, 15). Other element would receive the click: <div class="banner-content slick-initialized slick-slider" id="banner-content">...</div>
this.client.setValue(ref.sortby_selectbox.selector, sortOption);
Where sortby_selectbox identifies a dropdown menu and sortOption is the element within the dropdown to select. This command worked fine in NW1.7 but in NW2.0 I receive this error message:
` Error while running .setElementValue() protocol action: invalid element state
(Session info: chrome=99.0.4844.74)
TimeoutError: An error occurred while running .setValue() command on <div.sort-selection-block select.select-sort-order>: invalid element state
(Session info: chrome=99.0.4844.74)`
I have managed to create a workaround where I click on the dropdown and then click on the element. This works but is more cumbersome to use and would involve rewriting quite a few step definitions.
this.client.elements('css selector', ref.search_result_page_sales_price.selector, function (result) { var elementsList = result.value;
This creates a list of elements that do NOT have ELEMENT defined. The array of elements that is created contains an array that prints out like this:
{ 'element-6066-11e4-a52e-4f735466cecf': 'b82dab6f-2a8b-4c2b-b5ff-1b5aba211f58' }
Note that there is no ELEMENT value assigned. I have made a workaround by adding this command for each element of the array:
element.ELEMENT = element[Object.keys(element)[0]];
I am working under the assumption that these three items are bugs in NW2.0
Please let me know if they are not and that I am doing something wrong.
Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions