How to use this.getAttribute method in Appium Xcuitest Driver

Best JavaScript code snippet using appium-xcuitest-driver

search.js

Source:search.js Github

copy

Full Screen

...296    var retrievedObject = localStorage.getItem('localStorageGoods')297    var getlocalStorageGoods = JSON.parse(retrievedObject)298    var temporaryLocalStorage = []299    ping = this.parentNode.childNodes[1].innerText300    if (this.getAttribute("data-promotionflag") == "1") {301        var getLSG = JSON.parse(localStorage.getItem('localStorageGoods'))302        if (getLSG != null) {303            for (var l = 0; l < getLSG.length; l++) {304                var thisId = this.getAttribute("data-id")305                if (Number(thisId) == Number(getLSG[l].id) && Number(this.getAttribute("data-commoditytype")) == Number(getLSG[l].commoditytype)) {306                  if (getLSG.length != 0) {307                    if (getLSG[l].amount != 0) {308                            ping++309                            if (getlocalStorageGoods != null) {310                                temporaryLocalStorage = getlocalStorageGoods311                                temporaryLocalStorageLength = temporaryLocalStorage.length312                                for (var i = 0; i < temporaryLocalStorageLength; i++) {313                                    if (this.getAttribute("data-id") == temporaryLocalStorage[i].id && this.getAttribute("data-commoditytype") == temporaryLocalStorage[i].commoditytype) {314                                        if (temporaryLocalStorage[i].amount == this.getAttribute("data-stockamount")) {315                                            _e.msgBox({316                                                msg: "库存不足!",317                                                timeout: 2000,318                                                className: "error"319                                            })320                                            return321                                        }322                                        temporaryLocalStorage[i].amount++323                                        if (this.getAttribute("data-promotionflag") == "1") {324                                          if(temporaryLocalStorage[i].amount>Number(this.getAttribute("data-promotion-repeatpurchasetimes"))){325                                    _e.msgBox({326                                        msg: "不享受优惠!",327                                        timeout: 700,328                                        className: "error"329                                    })330                                    return331                                  }332                                            if (Number(this.getAttribute("data-promotion-count")) < Number(this.getAttribute("data-promotion-reapttimes"))) {333                                              if(this.getAttribute("data-promotion-buys")>1){334                                                if (temporaryLocalStorage[i].amount>=Number(this.getAttribute("data-promotion-buys"))&&temporaryLocalStorage[i].amount <= (Number(this.getAttribute("data-promotion-reapttimes")) - Number(this.getAttribute("data-promotion-count"))) * Number(this.getAttribute("data-promotion-buys"))) {335                                                  _e.msgBox({336                                                    msg: "享受优惠!",337                                                    timeout: 700,338                                                    className: "info"339                                                  })340                                                } else {341                                                  _e.msgBox({342                                                    msg: "不享受优惠!",343                                                    timeout: 700,344                                                    className: "error"345                                                  })346                                                }347                                              }else{348                                                if (temporaryLocalStorage[i].amount <= ((json.message[0].promotion[0].data.reapttimes - json.message[0].promotion[0].data.count) * json.message[0].promotion[0].data.buys)) {349                                                  _e.msgBox({350                                                    msg: "享受优惠!",351                                                    timeout: 700,352                                                    className: "info"353                                                  })354                                                } else {355                                                  _e.msgBox({356                                                    msg: "不享受优惠!",357                                                    timeout: 700,358                                                    className: "error"359                                                  })360                                                }361                                              }362                                            } else {363                                                _e.msgBox({364                                                    msg: "不享受优惠!",365                                                    timeout: 700,366                                                    className: "error"367                                                })368                                            }369                                        }370                                            if (this.getAttribute("data-promotionflag") == "2" || this.getAttribute("data-promotionflag") == "3" || this.getAttribute("data-promotionflag") == "4") {371                                              if(temporaryLocalStorage[i].amount>Number(this.getAttribute("data-promotion-repeatpurchasetimes"))){372                                                    _e.msgBox({373                                                        msg: "不享受优惠!",374                                                        timeout: 700,375                                                        className: "error"376                                                    })377                                                    return378                                                  }379                                                if (this.getAttribute("data-promotion-count") < this.getAttribute("data-promotion-reapttimes")) {380                                                    if (temporaryLocalStorage[i].amount <= (this.getAttribute("data-promotion-reapttimes") - this.getAttribute("data-promotion-count"))) {381                                                        _e.msgBox({382                                                            msg: "享受优惠!",383                                                            timeout: 2000,384                                                            className: "info"385                                                        })386                                                    } else {387                                                        _e.msgBox({388                                                            msg: "优惠次数已享完!",389                                                            timeout: 2000,390                                                            className: "error"391                                                        })392                                                    }393                                                } else {394                                                    _e.msgBox({395                                                        msg: "优惠次数已享完!",396                                                        timeout: 2000,397                                                        className: "error"398                                                    })399                                                }400                                            }401                                        this.parentNode.childNodes[0].style.display = "block"402                                        this.parentNode.childNodes[1].innerHTML = ping403                                        localStorage.setItem('localStorageGoods', JSON.stringify(temporaryLocalStorage))404                                        return405                                    }406                                }407                            }408                        } else {409                            location.href = 'http://www.newfan.net.cn/s/goodsdetail.html?comid=' + this.getAttribute("data-id") + '&commoditytype=' + this.getAttribute("data-commoditytype")410                            return411                        }412                    } else {413                        location.href = 'http://www.newfan.net.cn/s/goodsdetail.html?comid=' + this.getAttribute("data-id") + '&commoditytype=' + this.getAttribute("data-commoditytype")414                        return415                    }416                } else {417                    location.href = 'http://www.newfan.net.cn/s/goodsdetail.html?comid=' + this.getAttribute("data-id") + '&commoditytype=' + this.getAttribute("data-commoditytype")418                    return419                }420            }421        } else {422            location.href = 'http://www.newfan.net.cn/s/goodsdetail.html?comid=' + this.getAttribute("data-id") + '&commoditytype=' + this.getAttribute("data-commoditytype")423            return424        }425    }426    ping++427    if (getlocalStorageGoods != null) {428        temporaryLocalStorage = getlocalStorageGoods429        temporaryLocalStorageLength = temporaryLocalStorage.length430        for (var i = 0; i < temporaryLocalStorageLength; i++) {431            if (this.getAttribute("data-id") == temporaryLocalStorage[i].id && this.getAttribute("data-commoditytype") == temporaryLocalStorage[i].commoditytype) {432                if (temporaryLocalStorage[i].amount == this.getAttribute("data-stockamount")) {433                    _e.msgBox({434                        msg: "库存不足!",435                        timeout: 2000,436                        className: "error"437                    })438                    return439                }440                temporaryLocalStorage[i].amount++441                    if (this.getAttribute("data-promotionflag") == "2" || this.getAttribute("data-promotionflag") == "3" || this.getAttribute("data-promotionflag") == "4") {442                      if(temporaryLocalStorage[i].amount>Number(this.getAttribute("data-promotion-repeatpurchasetimes"))){443                                    _e.msgBox({444                                        msg: "不享受优惠!",445                                        timeout: 700,446                                        className: "error"447                                    })448                                    return449                                  }450                        if (this.getAttribute("data-promotion-count") < this.getAttribute("data-promotion-reapttimes")) {451                            if (temporaryLocalStorage[i].amount <= (this.getAttribute("data-promotion-reapttimes") - this.getAttribute("data-promotion-count"))) {452                                _e.msgBox({453                                    msg: "享受优惠!",454                                    timeout: 2000,455                                    className: "info"456                                })457                            } else {458                                _e.msgBox({459                                    msg: "优惠次数已享完!",460                                    timeout: 2000,461                                    className: "error"462                                })463                            }464                        } else {465                            _e.msgBox({466                                msg: "优惠次数已享完!",467                                timeout: 2000,468                                className: "error"469                            })470                        }471                    }472                this.parentNode.childNodes[0].style.display = "block"473                this.parentNode.childNodes[1].innerHTML = ping474                localStorage.setItem('localStorageGoods', JSON.stringify(temporaryLocalStorage))475                return476            }477        }478    }479    temporaryLocalStorage[temporaryLocalStorageLength] = {}480    temporaryLocalStorage[temporaryLocalStorageLength]["id"] = this.getAttribute("data-id")481    temporaryLocalStorage[temporaryLocalStorageLength]["name"] = this.getAttribute("data-name")482    temporaryLocalStorage[temporaryLocalStorageLength]["url"] = this.getAttribute("data-url")483    temporaryLocalStorage[temporaryLocalStorageLength]["commoditytype"] = this.getAttribute("data-commoditytype")484    temporaryLocalStorage[temporaryLocalStorageLength]["delivery_interval"] = this.getAttribute("data-delivery_interval")485    temporaryLocalStorage[temporaryLocalStorageLength]["finishordder"] = this.getAttribute("data-finishordder")486    temporaryLocalStorage[temporaryLocalStorageLength]["groupprice"] = this.getAttribute("data-groupprice")487    temporaryLocalStorage[temporaryLocalStorageLength]["preorder"] = this.getAttribute("data-preorder")488    temporaryLocalStorage[temporaryLocalStorageLength]["preorderprice"] = this.getAttribute("data-preorderprice")489    temporaryLocalStorage[temporaryLocalStorageLength]["price"] = this.getAttribute("data-price")490    temporaryLocalStorage[temporaryLocalStorageLength]["flag"] = 1491    temporaryLocalStorage[temporaryLocalStorageLength]["promotionflag"] = this.getAttribute("data-promotionflag")492    temporaryLocalStorage[temporaryLocalStorageLength]["specification"] = this.getAttribute("data-specification")493    temporaryLocalStorage[temporaryLocalStorageLength]["startorder"] = this.getAttribute("data-startorder")494    temporaryLocalStorage[temporaryLocalStorageLength]["stockamount"] = this.getAttribute("data-stockamount")495    temporaryLocalStorage[temporaryLocalStorageLength]["unit"] = this.getAttribute("data-unit")496    temporaryLocalStorage[temporaryLocalStorageLength]["amount"] = 1497    temporaryLocalStorage[temporaryLocalStorageLength]["promotion"] = []498        // temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]={}499    temporaryLocalStorage[temporaryLocalStorageLength]["deliverytimes"] = 0500    if (this.getAttribute("data-promotionflag") == "2") {501        if (this.getAttribute(".count") > this.getAttribute("data-promotion-reapttimes")) {502            _e.msgBox({503                msg: "不享受优惠!",504                timeout: 2000,505                className: "error"506            })507        }508        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0] = {}509        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["count"] = this.getAttribute("data-promotion-count")510        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["discount"] = this.getAttribute("data-promotion-discount")511        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["reapttimes"] = this.getAttribute("data-promotion-reapttimes")512        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["repeatpurchasetimes"] = this.getAttribute("data-promotion-repeatpurchasetimes")513    }514    if (this.getAttribute("data-promotionflag") == "3") {515        if (this.getAttribute(".count") > this.getAttribute("data-promotion-reapttimes")) {516            _e.msgBox({517                msg: "不享受优惠!",518                timeout: 2000,519                className: "error"520            })521        }522        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0] = {}523        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["count"] = this.getAttribute("data-promotion-count")524        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["pv"] = this.getAttribute("data-promotion-pv")525        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["reapttimes"] = this.getAttribute("data-promotion-reapttimes")526        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["repeatpurchasetimes"] = this.getAttribute("data-promotion-repeatpurchasetimes")527    }528    if (this.getAttribute("data-promotionflag") == "4") {529        if (this.getAttribute(".count") > this.getAttribute("data-promotion-reapttimes")) {530            _e.msgBox({531                msg: "不享受优惠!",532                timeout: 2000,533                className: "error"534            })535        }536        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0] = {}537        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["count"] = this.getAttribute("data-promotion-count")538        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["cashgift"] = this.getAttribute("data-promotion-cashgift")539        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["reapttimes"] = this.getAttribute("data-promotion-reapttimes")540        temporaryLocalStorage[temporaryLocalStorageLength]["promotion"][0]["repeatpurchasetimes"] = this.getAttribute("data-promotion-repeatpurchasetimes")541    }542    console.log(temporaryLocalStorage)543    this.parentNode.childNodes[0].style.display = "block"544    this.parentNode.childNodes[1].innerHTML = ping545    temporaryLocalStorageLength++546    localStorage.setItem('localStorageGoods', JSON.stringify(temporaryLocalStorage))547}548function numBoxReduce() {549    window.event ? window.event.cancelBubble = true : e.stopPropagation();550    var retrievedObject = localStorage.getItem('localStorageGoods')551    var getlocalStorageGoods = JSON.parse(retrievedObject)552    var temporaryLocalStorage = []553    temporaryLocalStorage = getlocalStorageGoods554    var reduce = 0555    reduce = this.parentNode.childNodes[1].innerText556    for (var i = 0; i < temporaryLocalStorage.length; i++) {557      temporaryLocalStorage[i].amount--558        if (this.getAttribute("data-id") == temporaryLocalStorage[i].id && this.getAttribute("data-commoditytype") == temporaryLocalStorage[i].commoditytype) {559            if (this.getAttribute("data-promotionflag") == "2" || this.getAttribute("data-promotionflag") == "3" || this.getAttribute("data-promotionflag") == "4") {560                if (this.getAttribute("data-promotion-count") < this.getAttribute("data-promotion-reapttimes")) {561                    if (temporaryLocalStorage[i].amount <= (this.getAttribute("data-promotion-reapttimes") - this.getAttribute("data-promotion-count"))) {562                        _e.msgBox({563                            msg: "享受优惠!",564                            timeout: 2000,565                            className: "info"566                        })567                    } else {568                        _e.msgBox({569                            msg: "优惠次数已享完!",570                            timeout: 2000,571                            className: "error"572                        })573                    }574                } else {575                    _e.msgBox({576                        msg: "优惠次数已享完!",577                        timeout: 2000,578                        className: "error"579                    })580                }581            }582            if (this.getAttribute("data-promotionflag") == "1") {583                if (Number(this.getAttribute("data-promotion-count")) < Number(this.getAttribute("data-promotion-reapttimes"))) {584                  if(this.getAttribute("data-promotion-buys")>1){585                    if (temporaryLocalStorage[i].amount<=Number(this.getAttribute("data-promotion-buys"))&&temporaryLocalStorage[i].amount >= (Number(this.getAttribute("data-promotion-reapttimes")) - Number(this.getAttribute("data-promotion-count"))) * Number(this.getAttribute("data-promotion-buys"))) {586                      _e.msgBox({587                        msg: "享受优惠!",588                        timeout: 700,589                        className: "info"590                      })591                    } else {592                      _e.msgBox({593                        msg: "不享受优惠!",594                        timeout: 700,595                        className: "error"596                      })597                    }598                  }else{599                    if (temporaryLocalStorage[i].amount >= ((json.message[0].promotion[0].data.reapttimes - json.message[0].promotion[0].data.count) * json.message[0].promotion[0].data.buys)) {...

Full Screen

Full Screen

component.js

Source:component.js Github

copy

Full Screen

...10              render() {11                   if (!this.shadow) {12                        this.shadow = this.attachShadow({mode: 'open'});13                   }14                   this.shadow.innerHTML = `<input value="${this.getAttribute('name')}" />`;15              }16             connectedCallback() {17                this.render();18             }19             attributeChangedCallback(name, oldValue, newValue) {20                this.render();21             }22        });23        customElements.define('cmp-button-edit', class extends HTMLElement {24             shadow = null;25             static get observedAttributes() {26               return ['width','name', 'caption','data','value',"clearbutton"];27             }28             render() {29                if (!this.shadow) {30                     this.shadow = this.attachShadow({mode: 'open'});31                     if (!this.getAttribute('value')) {this.setAttribute('value',""); }32                }33                var clearbutton="";34                if ((this.getAttribute('clearbutton'))&&(this.getAttribute("clearbutton") == 'true')) {35                   clearbutton="<button style='display:inline;'>X</button>";36                }37                var styleTxt = ["display:inline"];38                if (this.getAttribute('width')) { styleTxt.push('width:'+this.getAttribute('width')); }else{ styleTxt.push('width:100px ') }39                styleTxt = styleTxt.join(";");40                this.shadow.innerHTML = `<div style='display:inline;'><input type="text"  value="${this.getAttribute('value')}"  style='${styleTxt}' /><button style="display:inline;">...</button>${clearbutton}</div>`;41             }42             connectedCallback() {43                this.render();44             }45             attributeChangedCallback(name, oldValue, newValue) {46                this.render();47             }48        });49        customElements.define('cmp-unit-edit', class extends HTMLElement {50             shadow = null;51             static get observedAttributes() {52               return ['width','name', 'caption','data','value',"clearbutton","unit","composition"];53             }54             render() {55                if (!this.shadow) {56                     this.shadow = this.attachShadow({mode: 'open'});57                     if (!this.getAttribute('value')) {this.setAttribute('value',""); }58                }59                var clearbutton="";60                if ((this.getAttribute('clearbutton'))&&(this.getAttribute("clearbutton") == 'true')) {61                   clearbutton="<button>X</button>";62                }63                var styleTxt = [];64                if (this.getAttribute('width')) { styleTxt.push('width:'+this.getAttribute('width')); }else{ styleTxt.push('width:100px ') }65                styleTxt = styleTxt.join(";");66                this.shadow.innerHTML = `<div><input type="text"  value="${this.getAttribute('value')}"  style='${styleTxt}' /><button>...</button>${clearbutton}</div>`;67             }68             connectedCallback() {69                this.render();70             }71             attributeChangedCallback(name, oldValue, newValue) {72                this.render();73             }74        });75        customElements.define('cmp-label', class extends HTMLElement {76              shadow = null;77              static get observedAttributes() {78                return ['width','name', 'caption','data','value'];79              }80              render() {81                   if (!this.shadow) {82                        this.shadow = this.attachShadow({mode: 'open'});83                   }84                   this.shadow.innerHTML = `<span name="${this.getAttribute('name')}" cmptype="Label" title="" class="label" >${this.getAttribute('caption')}</span>`;85              }86             connectedCallback() {87                this.render();88             }89             attributeChangedCallback(name, oldValue, newValue) {90                this.render();91             }92        });93        customElements.define('cmp-hyper-link', class extends HTMLElement {94              shadow = null;95              static get observedAttributes() {96                return ['width','name', 'caption','data'];97              }98              render() {99                   if (!this.shadow) {100                        this.shadow = this.attachShadow({mode: 'open'});101                        if (!this.getAttribute('name')) {this.setAttribute('name', "HYPER_LINK_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }102                   }103                   this.shadow.innerHTML = `<a name="${this.getAttribute('name')}" cmptype="" title="" class="label" >${this.getAttribute('caption')}</a>`;104              }105             connectedCallback() {106                this.render();107             }108             attributeChangedCallback(name, oldValue, newValue) {109                this.render();110             }111        });112        customElements.define('cmp-radio-group', class extends HTMLElement {113              shadow = null;114              static get observedAttributes() {115                return ['width','name', 'caption','value','title'];116              }117              render() {118                   if (!this.shadow) {119                        this.shadow = this.attachShadow({mode: 'open'});120                        if (!this.getAttribute('title')) {this.setAttribute('title',""); }121                        if (!this.getAttribute('value')) {this.setAttribute('value',""); }122                        if (!this.getAttribute('name')) {this.setAttribute('name', "radioGroup_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }123                   }124                   //${this.getAttribute('caption')}125                    this.shadow.innerHTML = "";126                    var tmpdataSet = document.createElement('template');127                    tmpdataSet.innerHTML = `128                      <span   name="${this.getAttribute('name')}"  cmptype="Radio" title="${this.getAttribute('title')}" value="${this.getAttribute('value')}" >129                         <slot></slot>130                      </span>131                    `;132                    this.shadow.appendChild(tmpdataSet.content.cloneNode(true));133              }134             connectedCallback() {135                this.render();136             }137             attributeChangedCallback(name, oldValue, newValue) {138                this.render();139             }140        });141        customElements.define('cmp-radio-item', class extends HTMLElement {142              shadow = null;143              static get observedAttributes() {144                return ['width', 'caption','value'];145              }146              render() {147                    if (!this.shadow) {148                        this.shadow = this.attachShadow({mode: 'open'});149                        if (!this.getAttribute('value')) {this.setAttribute('value',""); }150                    }151                    this.shadow.innerHTML = "";152                    var tmpdataSet = document.createElement('template');153                    var captionTxt="";154                    if (this.getAttribute('caption')) {155                        captionTxt="<label>"+this.getAttribute('caption')+"</label>"156                    }157                    tmpdataSet.innerHTML = `158                         <input type="radio"  name="${this.parentElement.getAttribute('name')}" value="${this.getAttribute('value')}">159                         ${captionTxt}160                    `;161                    this.shadow.appendChild(tmpdataSet.content.cloneNode(true));162              }163             connectedCallback() {164                this.render();165             }166             attributeChangedCallback(name, oldValue, newValue) {167                this.render();168             }169        });170        customElements.define('cmp-data-edit', class extends HTMLElement {171              shadow = null;172              static get observedAttributes() {173                 return ['width','name', 'caption', 'min','max','data','value','step' , "required", "mask_type"];174              }175              render() {176                 if (!this.shadow) {177                      this.shadow = this.attachShadow({mode: 'open'});178                 }179                 var atr = [];180                 if (this.getAttribute('required')) { atr.push(" required ") ; }181                 if (this.getAttribute('pattern')) { atr.push( ' pattern="'+this.getAttribute("pattern")+'" '); }182                 if (!this.getAttribute('mask_type')) {183                   atr.push( ' type="date" ');184                 }else{185                   var mask = this.getAttribute('mask_type')186                   if (mask == "date"){187                      atr.push( ' type="date" ');188                   }else if (mask == "datetime"){189                      atr.push( ' type="datetime-local" ');190                   }else if (mask == "time"){191                      atr.push( ' type="time" ');192                   }193                 }194                 atr = atr.join(" ");195                 var styleTxt = [];196                 if (this.getAttribute('width')) { styleTxt.push('width:'+this.getAttribute('width')); }else{ styleTxt.push('width:120px ') }197                 styleTxt = styleTxt.join(";");198                 this.shadow.innerHTML = `<input  value="${this.getAttribute('name')}" min="${this.getAttribute('min')}" max="${this.getAttribute('max')}" step="${this.getAttribute('step')}"  ${atr}   style="${styleTxt}" />`;199              }200             connectedCallback() {201                this.render();202             }203             attributeChangedCallback(name, oldValue, newValue) {204                this.render();205             }206        });207        customElements.define('cmp-button', class extends HTMLElement {208              shadow = null;209              static get observedAttributes() {210                return ['width','name', 'caption','data','value'];211              }212              render() {213                   var linkCss = "";214                   if (!this.shadow) {215                        this.shadow = this.attachShadow({mode: 'open'});216                        linkCss = `<link rel="stylesheet" type="text/css" href="Component/Button/css/Button.css" delettag="1">`;217                   }218                   var styleTxt = [];219                   if (this.getAttribute('width')) { styleTxt.push('width:'+this.getAttribute('width')); }else{ styleTxt.push('width:100px ') }220                   if (!this.getAttribute('caption')) this.setAttribute('caption',"cmpButton");221                   this.shadow.innerHTML = `<button name="${this.getAttribute('name')}" cmptype="Button" title="" class="button" title="${this.getAttribute('title')}"  style="${ styleTxt.join(';')}" >${this.getAttribute('caption')}</button>`;222                   /*223                   this.shadow.innerHTML = `224                       <link rel="stylesheet" type="text/css" href="Component/Button/css/Button.css" delettag="1">225                       <div name="${this.getAttribute('name')}" cmptype="Button" title="${this.getAttribute('title')}" tabindex="0" class="ctrl_button box-sizing-force" style="${ styleTxt.join(';')}" >226                            <div class="btn_caption btn_center minwidth">${this.getAttribute('caption')}</div>227                       </div>`;228                   */229              }230             connectedCallback() {231                this.render();232             }233             attributeChangedCallback(name, oldValue, newValue) {234                this.render();235             }236        });237        customElements.define('cmp-combo-box', class extends HTMLElement {238           static get observedAttributes() {239               return ['width','name', 'data','value'];240           }241           shadow = null;242           render() {243                if (!this.shadow) {244                     this.shadow = this.attachShadow({mode: 'open'});245                }246                var styleTxt = [];247                if (this.getAttribute('width')) { styleTxt.push('width:'+this.getAttribute('width')); }else{ styleTxt.push('width:100px ') }248                if (!this.getAttribute('value')) {this.setAttribute('value',""); }249                styleTxt = styleTxt.join(";");250                this.shadow .innerHTML = `<select name="${this.getAttribute('name')}" style='${styleTxt}' >${this.getAttribute('caption')}</select>`;251                /*252                this.shadow .innerHTML = `253                   <link rel="stylesheet" type="text/css" href="Component/ComboBox/css/ComboBox.css" delettag="1">254                   <div name="${this.getAttribute('name')}" cmptype="Combobox" title="" oncreate="" class="ctrl_combobox editControl box-sizing-force" id="d3ctrl4551622992271907">255                        <div class="cmbb-input">256                            <input cmpparse="ComboBox"  type="text" value="${this.getAttribute('value')}" >257                        </div>258                        <div cmpparse="ComboBox" class="cmbb-button"  title="Выбрать из списка"></div>259                        <div cmptype="Base" name="ComboItemsList_sss" id="d3ctrl4591622992271907">260                          <div cmptype="ComboBoxDL" cont="cmbbdroplist" class="cmbb-droplist" id="d3ctrl4621622992271907">261                           <table></table>262                          </div>263                        </div>264                   </div>`;265                 */266           }267          static get observedAttributes() {268             return ['width','name', 'caption','data'];269          }270          connectedCallback() {271             this.render();272          }273          attributeChangedCallback(name, oldValue, newValue) {274             this.render();275          }276        });277        customElements.define('cmp-combo-item', class extends HTMLElement {278              shadow = null;279              static get observedAttributes() {280                return ['width','name', 'caption','data','value'];281              }282              render() {283                   if (!this.shadow) {284                        this.shadow = this.attachShadow({mode: 'open'});285                   }286                  this.shadow.innerHTML = `<option name="${this.getAttribute('name')}" caption="${this.getAttribute('caption')}" value="${this.getAttribute('value')}" >${this.getAttribute('caption')}</select>`;287                  /*288                   this.shadow.innerHTML = `289                                 <tbody><tr cmptype="ComboItem" name="cmp60bcea7ed88c3" comboboxname="sss" value="${this.getAttribute('value')}" id="d3ctrl3211622993534891">290                                        <td>291                                            <div class="item_block">292                                                <span class="btnOC" comboboxname="sss"></span>293                                                <span cont="itemcaption"></span>294                                            </div>295                                        </td>296                                    </tr>297                                </tbody>298                   `;299                   */300              }301             connectedCallback() {302                this.render();303             }304             attributeChangedCallback(name, oldValue, newValue) {305                this.render();306             }307        });308        customElements.define('cmp-text-area', class extends HTMLElement {309              shadow = null;310              static get observedAttributes() {311                return ['width','name', 'data','value'];312              }313              render() {314                   if (!this.shadow) {315                        this.shadow = this.attachShadow({mode: 'open'});316                        if (!this.getAttribute('value')) {this.setAttribute('value',""); }317                   }318                  var styleTxt = [];319                  if (this.getAttribute('width')) { styleTxt.push('width:'+this.getAttribute('width')); }else{ styleTxt.push('width:100px ') }320                   styleTxt = styleTxt.join(";");321                  this.shadow.innerHTML = `<textarea name="${this.getAttribute('name')}"  style="${styleTxt}">${this.getAttribute('value')}</textarea>`;322              }323             connectedCallback() {324                this.render();325             }326             attributeChangedCallback(name, oldValue, newValue) {327                this.render();328             }329        });330        customElements.define('cmp-data-set-var', class extends HTMLElement {331            shadow = null;332            render() {333                if (!this.shadow) {334                        this.shadow = this.attachShadow({mode: 'open'});335                        if (!this.getAttribute('srctype')) {this.setAttribute('srctype',"var"); }336                        if (!this.getAttribute('name')) {this.setAttribute('name', "DS_VAR_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }337                        if (!this.getAttribute('src')) {this.setAttribute('src',this.getAttribute('name')); }338                }339                var tmpdataSetVar = document.createElement('template');340                tmpdataSetVar.innerHTML = ` <div  style="display:none;" ></div> `;341                this.shadow.appendChild(tmpdataSetVar.content.cloneNode(true));342            }343             connectedCallback() {344                this.render();345             }346             attributeChangedCallback(name, oldValue, newValue) {347                this.render();348             }349        });350        customElements.define('cmp-data-set', class extends HTMLElement {351              shadow = null;352              static get observedAttributes() {353                return ['width','name', 'data'];354              }355              render() {356                   if (!this.shadow) {357                        this.shadow = this.attachShadow({mode: 'open'});358                   }359                if (!this.getAttribute('name')) {this.setAttribute('name', "DS_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }360                var tmpAction = document.createElement('template');361                tmpAction.innerHTML = `362                  <div  style="display:none;" >363                     <slot></slot>364                  </div>365                 `;366                 this.shadow.appendChild(tmpAction.content.cloneNode(true));367             }368             connectedCallback() {369                this.render();370             }371             attributeChangedCallback(name, oldValue, newValue) {372                this.render();373             }374        });375        customElements.define('cmp-action-var', class extends HTMLElement {376              shadow = null;377              static get observedAttributes() {378                return ['width','name', 'data'];379              }380              render() {381                 if (!this.shadow) {382                    this.shadow = this.attachShadow({mode: 'open'});383                 }384                 if (!this.getAttribute('srctype')) {this.setAttribute('srctype',"var"); }385                 if (!this.getAttribute('name')) {this.setAttribute('name', "ACTION_VAR_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }386                 if (!this.getAttribute('src')) {this.setAttribute('src',this.getAttribute('name')); }387                 var tmpActionVar = document.createElement('template');388                 tmpActionVar.innerHTML = ` <div  style="display:none;" ></div> `;389                 this.shadow.appendChild(tmpActionVar.content.cloneNode(true));390              }391             connectedCallback() {392                this.render();393             }394             attributeChangedCallback(name, oldValue, newValue) {395                this.render();396             }397        });398        customElements.define('cmp-action', class extends HTMLElement {399              shadow = null;400              static get observedAttributes() {401                return ['width','name', 'data'];402              }403              render() {404                   if (!this.shadow) {405                        this.shadow = this.attachShadow({mode: 'open'});406                   }407                if (!this.getAttribute('name')) {this.setAttribute('name', "ACTION_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }408                var tmpAction = document.createElement('template');409                tmpAction.innerHTML = `410                  <div  style="display:none;" >411                     <slot></slot>412                  </div>413                 `;414                 this.shadow.appendChild(tmpAction.content.cloneNode(true));415              }416             connectedCallback() {417                this.render();418             }419             attributeChangedCallback(name, oldValue, newValue) {420                this.render();421             }422        });423        customElements.define('cmp-popup-menu', class extends HTMLElement {424            shadow = null;425              static get observedAttributes() {426                return ['width','name', 'data'];427              }428              render() {429                   if (!this.shadow) {430                        this.shadow = this.attachShadow({mode: 'open'});431                   }432                if (!this.getAttribute('name')) {this.setAttribute('name', "POPUP_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }433                var tmpAction = document.createElement('template');434                this.innerHTML = `435                  <div  style="display:none;" >436                     <slot></slot>437                  </div>438                `;439                 this.shadow.appendChild(tmpAction.content.cloneNode(true));440              }441             connectedCallback() {442                this.render();443             }444             attributeChangedCallback(name, oldValue, newValue) {445                this.render();446             }447        });448        customElements.define('cmp-auto-popup-menu', class extends HTMLElement {449              shadow = null;450              static get observedAttributes() {451                return ['width','name', 'data'];452              }453              render() {454                   if (!this.shadow) {455                        this.shadow = this.attachShadow({mode: 'open'});456                   }457                if (!this.getAttribute('name')) {this.setAttribute('name', "POPUP_AUTO_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }458                var tmpPopUp = document.createElement('template');459                tmpPopUp.innerHTML = `460                  <div  style="display:none;" >461                     <slot></slot>462                  </div>463                `;464                 this.shadow.appendChild(tmpPopUp.content.cloneNode(true));465              }466             connectedCallback() {467                this.render();468             }469             attributeChangedCallback(name, oldValue, newValue) {470                this.render();471             }472        });473        customElements.define('cmp-popup-item', class extends HTMLElement {474              shadow = null;475              static get observedAttributes() {476                return ['width','name', 'data'];477              }478              render() {479                   if (!this.shadow) {480                        this.shadow = this.attachShadow({mode: 'open'});481                   }482                if (!this.getAttribute('name')) {this.setAttribute('name', "POPUP_AUTO_"+getRandomInt(999999)+(new Date().getMilliseconds()) ); }483                var tmpPopUpItemVar = document.createElement('template');484                tmpPopUpItemVar.innerHTML = ` <div  style="display:none;" ></div> `;485                this.shadow.appendChild(tmpPopUpItemVar.content.cloneNode(true));486              }487             connectedCallback() {488                this.render();489             }490             attributeChangedCallback(name, oldValue, newValue) {491                this.render();492             }493        });494// ------------------------------------------------------------------------------------------------495// ------------------------------------------------------------------------------------------------496// ------------------------------------------------------------------------------------------------...

Full Screen

Full Screen

swfobject_source.js

Source:swfobject_source.js Github

copy

Full Screen

...72	},73	getSWFHTML: function() {74		var swfNode = "";75		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture76			if (this.getAttribute("doExpressInstall")) {77				this.addVariable("MMplayerType", "PlugIn");78				this.setAttribute('swf', this.xiSWFPath);79			}80			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';81			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';82			var params = this.getParams();83			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }84			var pairs = this.getVariablePairs().join("&");85			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }86			swfNode += '/>';87		} else { // PC IE88			if (this.getAttribute("doExpressInstall")) {89				this.addVariable("MMplayerType", "ActiveX");90				this.setAttribute('swf', this.xiSWFPath);91			}92			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';93			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';94			var params = this.getParams();95			for(var key in params) {96			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';97			}98			var pairs = this.getVariablePairs().join("&");99			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}100			swfNode += "</object>";101		}102		return swfNode;103	},104	write: function(elementId){105		if(this.getAttribute('useExpressInstall')) {106			// check to see if we need to do an express install107			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);108			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {109				this.setAttribute('doExpressInstall', true);110				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));111				document.title = document.title.slice(0, 47) + " - Flash Player Installation";112				this.addVariable("MMdoctitle", document.title);113			}114		}115		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){116			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;117			n.innerHTML = this.getSWFHTML();118			return true;119		}else{120			if(this.getAttribute('redirectUrl') != "") {121				document.location.replace(this.getAttribute('redirectUrl'));122			}123		}124		return false;125	}126}127/* ---- detection functions ---- */128deconcept.SWFObjectUtil.getPlayerVersion = function(){129	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);130	if(navigator.plugins && navigator.mimeTypes.length){131		var x = navigator.plugins["Shockwave Flash"];132		if(x && x.description) {133			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));134		}135	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE...

Full Screen

Full Screen

javascript.swfobject.js

Source:javascript.swfobject.js Github

copy

Full Screen

...66	},67	getSWFHTML: function() {68		var swfNode = "";69		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture70			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }71			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';72			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';73			var params = this.getParams();74			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }75			var pairs = this.getVariablePairs().join("&");76			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }77			swfNode += '/>';78		} else { // PC IE79			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }80			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';81			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';82			var params = this.getParams();83			for(var key in params) {84			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';85			}86			var pairs = this.getVariablePairs().join("&");87			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}88			swfNode += "</object>";89		}90		return swfNode;91	},92	write: function(elementId){93		if(this.getAttribute('useExpressInstall')) {94			// check to see if we need to do an express install95			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);96			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {97				this.setAttribute('doExpressInstall', true);98				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));99				document.title = document.title.slice(0, 47) + " - Flash Player Installation";100				this.addVariable("MMdoctitle", document.title);101			}102		}103		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){104			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;105			n.innerHTML = this.getSWFHTML();106			return true;107		}else{108			if(this.getAttribute('redirectUrl') != "") {109				document.location.replace(this.getAttribute('redirectUrl'));110			}111		}112		return false;113	}114}115/* ---- detection functions ---- */116deconcept.SWFObjectUtil.getPlayerVersion = function(){117	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);118	if(navigator.plugins && navigator.mimeTypes.length){119		var x = navigator.plugins["Shockwave Flash"];120		if(x && x.description) {121			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));122		}123	}else{...

Full Screen

Full Screen

swfobject.js

Source:swfobject.js Github

copy

Full Screen

...21if(id){this.setAttribute("id",id);}22if(w){this.setAttribute("width",w);}23if(h){this.setAttribute("height",h);}24if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}25this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);26if(c){this.addParam("bgcolor",c);}27var q=_8?_8:"high";28this.addParam("quality",q);29this.setAttribute("useExpressInstall",_7);30this.setAttribute("doExpressInstall",false);31var _d=(_9)?_9:window.location;32this.setAttribute("xiRedirectUrl",_d);33this.setAttribute("redirectUrl","");34if(_a){this.setAttribute("redirectUrl",_a);}};35deconcept.SWFObject.prototype={setAttribute:function(_e,_f){36this.attributes[_e]=_f;37},getAttribute:function(_10){38return this.attributes[_10];39},addParam:function(_11,_12){40this.params[_11]=_12;41},getParams:function(){42return this.params;43},addVariable:function(_13,_14){44this.variables[_13]=_14;45},getVariable:function(_15){46return this.variables[_15];47},getVariables:function(){48return this.variables;49},getVariablePairs:function(){50var _16=new Array();51var key;52var _18=this.getVariables();53for(key in _18){54_16.push(key+"="+_18[key]);}55return _16;56},getSWFHTML:function(){57var _19="";58if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){59if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}60_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";61_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";62var _1a=this.getParams();63for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}64var _1c=this.getVariablePairs().join("&");65if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}66_19+="/>";67}else{68if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}69_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";70_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";71var _1d=this.getParams();72for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}73var _1f=this.getVariablePairs().join("&");74if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}75_19+="</object>";}76return _19;77},write:function(_20){78if(this.getAttribute("useExpressInstall")){79var _21=new deconcept.PlayerVersion([6,0,65]);80if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){81this.setAttribute("doExpressInstall",true);82this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));83document.title=document.title.slice(0,47)+" - Flash Player Installation";84this.addVariable("MMdoctitle",document.title);}}85if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){86var n=(typeof _20=="string")?document.getElementById(_20):_20;87n.innerHTML=this.getSWFHTML();88return true;89}else{90if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}91return false;}};92deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){93var _25=new deconcept.PlayerVersion([0,0,0]);94if(navigator.plugins&&navigator.mimeTypes.length){95var x=navigator.plugins["Shockwave Flash"];96if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}97}else{try{98var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");99for(var i=3;axo!=null;i++){100axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);101_25=new deconcept.PlayerVersion([i,0,0]);}}102catch(e){}103if(_23&&_25.major>_23.major){return _25;}104if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
...

Full Screen

Full Screen

vakata-jstree.js

Source:vakata-jstree.js Github

copy

Full Screen

...17			var c = { core : {}, plugins : [] }, i;18			for(i in $.jstree.plugins) {19				if($.jstree.plugins.hasOwnProperty(i) && this.attributes[i]) {20					c.plugins.push(i);21					if(this.getAttribute(i) && JSON.parse(this.getAttribute(i))) {22						c[i] = JSON.parse(this.getAttribute(i));23					}24				}25			}26			for(i in $.jstree.defaults.core) {27				if($.jstree.defaults.core.hasOwnProperty(i) && this.attributes[i]) {28					c.core[i] = JSON.parse(this.getAttribute(i)) || this.getAttribute(i);29				}30			}31			$(this).jstree(c);32		};33		// proto.attributeChangedCallback = function (name, previous, value) { };34		try {35			window.customElements.define("vakata-jstree", function() {}, { prototype: proto });36		} catch (ignore) { }37	}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { remote } = require('webdriverio');2(async () => {3    const browser = await remote({4        capabilities: {5        }6    })7    const element = await browser.$('~TextField1')8    const value = await element.getAttribute('value')9    console.log(value)10})().catch((e) => console.error(e))11[debug] [WD Proxy] Got response with status 200: {"value":"TextField1","sessionId":"8F0F2E2B-5D5C-4D8C-8E2A-4D4A4F4F4B4A"}

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriver = require('selenium-webdriver');2var assert = require('selenium-webdriver/testing/assert');3var By = webdriver.By;4var until = webdriver.until;5var driver = new webdriver.Builder().forBrowser('chrome').build();6driver.findElement(By.name('q')).sendKeys('webdriver');7driver.findElement(By.name('btnK')).click();8driver.wait(until.titleIs('webdriver - Google Search'), 1000);9driver.findElement(By.name('btnK')).getAttribute('value').then(function(text){10    console.log('The value is: ' + text);11    assert(text).equalTo('Google Search');12});13driver.quit();14info: [debug] [JSONWP Proxy] Got response with status 200: "{\"value\":\"Google Search\",\"sessionId\":\"1C000000-0000-0000-0F9C-000000000000\",\"status\":0}"15info: [debug] [MJSONWP] Responding to client with driver.getAttribute() result: "Google Search"16info: [debug] [JSONWP Proxy] Got response with status 200: "{\"value\":\"Google Search\",\"sessionId\":\"1C000000-0000-0000-0F9C-000000000000\",\"status\":0}"

Full Screen

Using AI Code Generation

copy

Full Screen

1const wdio = require('webdriverio');2const assert = require('assert');3const opts = {4    capabilities: {5    }6};7async function main() {8    const client = await wdio.remote(opts);9    await client.pause(5000);10    const element = await client.$('~Login');11    const element2 = await client.$('~Login');12    const element3 = await client.$('~Login');13    const element4 = await client.$('~Login');14    const element5 = await client.$('~Login');15    const element6 = await client.$('~Login');16    const element7 = await client.$('~Login');17    const element8 = await client.$('~Login');18    const element9 = await client.$('~Login');19    const element10 = await client.$('~Login');20    const element11 = await client.$('~Login');21    const element12 = await client.$('~Login');22    const element13 = await client.$('~Login');23    const element14 = await client.$('~Login');24    const element15 = await client.$('~Login');25    const element16 = await client.$('~Login');26    const element17 = await client.$('~Login');27    const element18 = await client.$('~Login');28    const element19 = await client.$('~Login');29    const element20 = await client.$('~Login');30    const element21 = await client.$('~Login');31    const element22 = await client.$('~Login');32    const element23 = await client.$('~Login');33    const element24 = await client.$('~Login');34    const element25 = await client.$('~Login');35    const element26 = await client.$('~Login');36    const element27 = await client.$('~Login');37    const element28 = await client.$('~Login');38    const element29 = await client.$('~Login');

Full Screen

Using AI Code Generation

copy

Full Screen

1const wdio = require("webdriverio");2const assert = require('assert');3const opts = {4  capabilities: {5  },6};7const client = wdio.remote(opts);8(async function myFunc() {9  try {10    await client.init();11    await client.pause(5000);12    await client.click("~button1");13    await client.pause(5000);14    var element = await client.$("~button2");15    console.log(element);16    var attribute = await element.getAttribute('name');17    console.log(attribute);18    await client.pause(5000);19    await client.deleteSession();20  } catch (err) {21    console.log(err);22  }23})();

Full Screen

Using AI Code Generation

copy

Full Screen

1var elementID = "elementID";2var attributeName = "name";3var elementName = this.getAttribute(attributeName, elementID);4var elementID = "elementID";5var attributeName = "label";6var elementName = this.getAttribute(attributeName, elementID);7var elementID = "elementID";8var attributeName = "value";9var elementName = this.getAttribute(attributeName, elementID);10var elementID = "elementID";11var attributeName = "type";12var elementName = this.getAttribute(attributeName, elementID);13var elementID = "elementID";14var attributeName = "rect";15var elementName = this.getAttribute(attributeName, elementID);16var elementID = "elementID";17var attributeName = "enabled";18var elementName = this.getAttribute(attributeName, elementID);19var elementID = "elementID";20var attributeName = "visible";21var elementName = this.getAttribute(attributeName, elementID);22var elementID = "elementID";23var attributeName = "valid";24var elementName = this.getAttribute(attributeName, elementID);25var elementID = "elementID";26var attributeName = "hint";27var elementName = this.getAttribute(attributeName, elementID);28var elementID = "elementID";

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Appium Xcuitest Driver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Sign up Free
_

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful