Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.elements('xpath', ".//a[@class='abcd')]", function (allButtons){
- console.log('Element value is '+element)
- allButtons.value.forEach(function (element) {
- this.elementIdClick(element, function(res){});
- }
- }
- TypeError: Object #<Object> has no method 'elementIdClick'
- client.elements('xpath', ".//a[@class='abcd')]", function (allButtons){
- allButtons.value.forEach(function (element) {
- console.log('Element value is '+element)
- this.elementIdClick(this.elementIdAttribute(allButtons.value[element].ELEMENT, 'id'), function(res){});
- Element value is [object Object]
- TypeError: Cannot read property 'ELEMENT' of undefined
- function iter(elems) {
- elems.value.forEach(function(element) {
- client.elementIdClick(element.ELEMENT)
- })
- };
- client.elements('css selector', 'button.my-button.to-iterate', iter);
- client.elements('xpath', ".//a[@class='abcd')]", function (allButtons){
- allButtons.value.forEach(function (index) {
- console.log('Element value is '+index.ELEMENT)
- client.elementIdClick(index.ELEMENT);}})
- // Executing a function in the application context.
- client.execute(function () {
- // Get elements by CSS selector.
- var elements = document.querySelectorAll('.elements');
- // Iterate over them.
- [].forEach.call(elements, function (element) {
- // Manipulate each element.
- element.click();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement