1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[20326],{13533:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"api/mjsonwp","title":"Mobile JSON Wire Protocol","description":"getPageIndex","source":"@site/docs/api/_mjsonwp.md","sourceDirName":"api","slug":"/api/mjsonwp","permalink":"/docs/api/mjsonwp","draft":false,"unlisted":false,"editUrl":"https://github.com/webdriverio/webdriverio/edit/main/packages/wdio-protocols/src/protocols/mjsonwp.ts","tags":[],"version":"current","frontMatter":{"id":"mjsonwp","title":"Mobile JSON Wire Protocol","custom_edit_url":"https://github.com/webdriverio/webdriverio/edit/main/packages/wdio-protocols/src/protocols/mjsonwp.ts"},"sidebar":"api","previous":{"title":"Firefox","permalink":"/docs/api/gecko"},"next":{"title":"Sauce Labs","permalink":"/docs/api/saucelabs"}}');var r=n(86106),t=n(22002);const o={id:"mjsonwp",title:"Mobile JSON Wire Protocol",custom_edit_url:"https://github.com/webdriverio/webdriverio/edit/main/packages/wdio-protocols/src/protocols/mjsonwp.ts"},c=void 0,d={},l=[{value:"getPageIndex",id:"getpageindex",level:2},{value:"Usage",id:"usage",level:3},{value:"Returns",id:"returns",level:3},{value:"getNetworkConnection",id:"getnetworkconnection",level:2},{value:"Usage",id:"usage-1",level:3},{value:"Returns",id:"returns-1",level:3},{value:"setNetworkConnection",id:"setnetworkconnection",level:2},{value:"Usage",id:"usage-2",level:3},{value:"Parameters",id:"parameters",level:3},{value:"touchPerform",id:"touchperform",level:2},{value:"Usage",id:"usage-3",level:3},{value:"Parameters",id:"parameters-1",level:3},{value:"multiTouchPerform",id:"multitouchperform",level:2},{value:"Usage",id:"usage-4",level:3},{value:"Parameters",id:"parameters-2",level:3},{value:"receiveAsyncResponse",id:"receiveasyncresponse",level:2},{value:"Usage",id:"usage-5",level:3},{value:"Parameters",id:"parameters-3",level:3}];function a(e){const s={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h2,{id:"getpageindex",children:"getPageIndex"}),"\n",(0,r.jsxs)(s.p,{children:["Mobile JSON Wire Protocol command. More details can be found in the ",(0,r.jsx)(s.a,{href:"https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#mobile-json-wire-protocol-endpoints",children:"official protocol docs"}),"."]}),"\n",(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsxs)(s.p,{children:["This protocol command is deprecated",(0,r.jsx)("br",{}),"In Appium 2.0, this method is marked as deprecated and currently has no available alternatives."]})}),"\n",(0,r.jsx)(s.h3,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"await driver.getPageIndex()\n"})}),"\n",(0,r.jsx)(s.h3,{id:"returns",children:"Returns"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsx)(s.li,{children:(0,r.jsx)(s.strong,{children:"<string>"})}),"\n"]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:"getnetworkconnection",children:"getNetworkConnection"}),"\n",(0,r.jsxs)(s.p,{children:["Mobile JSON Wire Protocol command. More details can be found in the ",(0,r.jsx)(s.a,{href:"https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes",children:"official protocol docs"}),"."]}),"\n",(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsxs)(s.p,{children:["This protocol command is deprecated",(0,r.jsx)("br",{}),"For Appium Android automation, use ",(0,r.jsx)(s.code,{children:"driver.execute('mobile: getConnectivity', { ... })"})," instead"]})}),"\n",(0,r.jsx)(s.h3,{id:"usage-1",children:"Usage"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"await driver.getNetworkConnection()\n"})}),"\n",(0,r.jsx)(s.h3,{id:"returns-1",children:"Returns"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.strong,{children:"<number>"}),"\n",(0,r.jsxs)(s.strong,{children:[(0,r.jsx)("code",{children:(0,r.jsx)("var",{children:"connectionType"})}),":"]})," see ",(0,r.jsx)(s.a,{href:"https://appium.github.io/appium.io/docs/en/writing-running-appium/other/network-connection/",children:"https://appium.github.io/appium.io/docs/en/writing-running-appium/other/network-connection/"})]}),"\n"]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:"setnetworkconnection",children:"setNetworkConnection"}),"\n",(0,r.jsxs)(s.p,{children:["Mobile JSON Wire Protocol command. More details can be found in the ",(0,r.jsx)(s.a,{href:"https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes",children:"official protocol docs"}),"."]}),"\n",(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsxs)(s.p,{children:["This protocol command is deprecated",(0,r.jsx)("br",{}),"For Appium Android automation, use ",(0,r.jsx)(s.code,{children:"driver.execute('mobile: setConnectivity', { ... })"})," instead"]})}),"\n",(0,r.jsx)(s.h3,{id:"usage-2",children:"Usage"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"await driver.setNetworkConnection(type)\n"})}),"\n",(0,r.jsx)(s.h3,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Name"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Details"})]})}),(0,r.jsx)(s.tbody,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"type"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"number"})}),(0,r.jsx)(s.td,{children:"a bit mask that should be translated to an integer value when serialized"})]})})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:"touchperform",children:"touchPerform"}),"\n",(0,r.jsxs)(s.p,{children:["Mobile JSON Wire Protocol command. More details can be found in the ",(0,r.jsx)(s.a,{href:"https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#touch-gestures",children:"official protocol docs"}),"."]}),"\n",(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsxs)(s.p,{children:["This protocol command is deprecated",(0,r.jsx)("br",{}),"For Appium, use ",(0,r.jsx)(s.code,{children:"driver.performActions(...)"})," instead"]})}),"\n",(0,r.jsx)(s.h3,{id:"usage-3",children:"Usage"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"await driver.touchPerform(actions)\n"})}),"\n",(0,r.jsx)(s.h3,{id:"parameters-1",children:"Parameters"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Name"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Details"})]})}),(0,r.jsx)(s.tbody,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"actions"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"object[]"})}),(0,r.jsx)(s.td,{children:"a list of objects, each of which represents an input source and its associated actions"})]})})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:"multitouchperform",children:"multiTouchPerform"}),"\n",(0,r.jsxs)(s.p,{children:["Mobile JSON Wire Protocol command. More details can be found in the ",(0,r.jsx)(s.a,{href:"https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#touch-gestures",children:"official protocol docs"}),"."]}),"\n",(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsxs)(s.p,{children:["This protocol command is deprecated",(0,r.jsx)("br",{}),"For Appium, use ",(0,r.jsx)(s.code,{children:"driver.performActions(...)"})," instead"]})}),"\n",(0,r.jsx)(s.h3,{id:"usage-4",children:"Usage"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"await driver.multiTouchPerform(actions, elementId)\n"})}),"\n",(0,r.jsx)(s.h3,{id:"parameters-2",children:"Parameters"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Name"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Details"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"actions"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"object[]"})}),(0,r.jsx)(s.td,{children:"a list of objects, each of which represents an input source and its associated actions"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"elementId"}),(0,r.jsx)("br",{}),(0,r.jsx)(s.em,{children:"optional"})]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"object[]"})}),(0,r.jsx)(s.td,{children:"the id of an element returned in a previous call to Find Element(s)"})]})]})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h2,{id:"receiveasyncresponse",children:"receiveAsyncResponse"}),"\n",(0,r.jsxs)(s.p,{children:["Mobile JSON Wire Protocol command. More details can be found in the ",(0,r.jsx)(s.a,{href:"https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#mobile-json-wire-protocol-endpoints",children:"official protocol docs"}),"."]}),"\n",(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsxs)(s.p,{children:["This protocol command is deprecated",(0,r.jsx)("br",{}),"For Appium, use ",(0,r.jsx)(s.code,{children:"driver.executeAsyncScript(...)"})," instead"]})}),"\n",(0,r.jsx)(s.h3,{id:"usage-5",children:"Usage"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"await driver.receiveAsyncResponse(status, value)\n"})}),"\n",(0,r.jsx)(s.h3,{id:"parameters-3",children:"Parameters"}),"\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Name"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Details"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"status"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"string"})}),(0,r.jsx)(s.td,{children:"the expected status of the response"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"value"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"string"})}),(0,r.jsx)(s.td,{children:"the expected value of the response"})]})]})]})]})}function h(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},22002:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>c});var i=n(7378);const r={},t=i.createContext(r);function o(e){const s=i.useContext(t);return i.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(t.Provider,{value:s},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.