1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[21470],{22002:(e,n,l)=>{l.d(n,{R:()=>t,x:()=>c});var i=l(7378);const s={},r=i.createContext(s);function t(e){const n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:t(e.components),i.createElement(r.Provider,{value:n},e.children)}},40564:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>t,metadata:()=>i,toc:()=>o});const i=JSON.parse('{"id":"ocr-testing/ocr-set-value","title":"ocrSetValue","description":"Send a sequence of key strokes to an element. It will:","source":"@site/docs/ocr-testing/ocr-set-value.md","sourceDirName":"ocr-testing","slug":"/ocr-testing/ocr-set-value","permalink":"/docs/ocr-testing/ocr-set-value","draft":false,"unlisted":false,"editUrl":"https://github.com/webdriverio/webdriverio/edit/main/website/docs/ocr-testing/ocr-set-value.md","tags":[],"version":"current","frontMatter":{"id":"ocr-set-value","title":"ocrSetValue"},"sidebar":"docs","previous":{"title":"ocrGetText","permalink":"/docs/ocr-testing/ocr-get-text"},"next":{"title":"ocrWaitForTextDisplayed","permalink":"/docs/ocr-testing/ocr-wait-for-text-displayed"}}');var s=l(86106),r=l(22002);const t={id:"ocr-set-value",title:"ocrSetValue"},c=void 0,d={},o=[{value:"Usage",id:"usage",level:2},{value:"Output",id:"output",level:2},{value:"Logs",id:"logs",level:3},{value:"Options",id:"options",level:2},{value:"<code>text</code>",id:"text",level:3},{value:"Example",id:"example",level:4},{value:"<code>value</code>",id:"value",level:3},{value:"Example",id:"example-1",level:4},{value:"<code>submitValue</code>",id:"submitvalue",level:3},{value:"Example",id:"example-2",level:4},{value:"<code>clickDuration</code>",id:"clickduration",level:3},{value:"Example",id:"example-3",level:4},{value:"<code>contrast</code>",id:"contrast",level:3},{value:"Example",id:"example-4",level:4},{value:"<code>haystack</code>",id:"haystack",level:3},{value:"Example",id:"example-5",level:4},{value:"<code>language</code>",id:"language",level:3},{value:"Example",id:"example-6",level:4},{value:"<code>relativePosition</code>",id:"relativeposition",level:3},{value:"<code>relativePosition.above</code>",id:"relativepositionabove",level:4},{value:"Example",id:"example-7",level:5},{value:"<code>relativePosition.right</code>",id:"relativepositionright",level:4},{value:"Example",id:"example-8",level:5},{value:"<code>relativePosition.below</code>",id:"relativepositionbelow",level:4},{value:"Example",id:"example-9",level:5},{value:"<code>relativePosition.left</code>
1",id:"relativepositionleft",level:4},{value:"Example",id:"example-10",level:5},{value:"<code>fuzzyFindOptions</code>",id:"fuzzyfindoptions",level:3},{value:"<code>fuzzyFindOptions.distance</code>",id:"fuzzyfindoptionsdistance",level:4},{value:"Example",id:"example-11",level:5},{value:"<code>fuzzyFindOptions.location</code>",id:"fuzzyfindoptionslocation",level:4},{value:"Example",id:"example-12",level:5},{value:"<code>fuzzyFindOptions.threshold</code>",id:"fuzzyfindoptionsthreshold",level:4},{value:"Example",id:"example-13",level:5},{value:"<code>fuzzyFindOptions.isCaseSensitive</code>",id:"fuzzyfindoptionsiscasesensitive",level:4},{value:"Example",id:"example-14",level:5},{value:"<code>fuzzyFindOptions.minMatchCharLength</code>",id:"fuzzyfindoptionsminmatchcharlength",level:4},{value:"Example",id:"example-15",level:5},{value:"<code>fuzzyFindOptions.findAllMatches</code>",id:"fuzzyfindoptionsfindallmatches",level:4},{value:"Example",id:"example-16",level:5}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",h5:"h5",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Send a sequence of key strokes to an element. It will:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"automatically detect the element"}),"\n",(0,s.jsx)(n.li,{children:"put focus on the field by clicking on it"}),"\n",(0,s.jsx)(n.li,{children:"set the value in the field"}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The command will search for the provided text and try to find a match based on Fuzzy Logic from ",(0,s.jsx)(n.a,{href:"https://fusejs.io/",children:"Fuse.js"}),". This means that if you might provide a selector with a typo, or the found text might not be a 100% match it will still try to give you back an element. See the ",(0,s.jsx)(n.a,{href:"#logs",children:"logs"})," below."]}),"\n",(0,s.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await brower.ocrSetValue({\n text: "docs",\n value: "specfileretries",\n});\n'})}),"\n",(0,s.jsx)(n.h2,{id:"output",children:"Output"}),"\n",(0,s.jsx)(n.h3,{id:"logs",children:"Logs"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-log",children:'[0-0] 2024-05-26T04:17:51.355Z INFO webdriver: COMMAND ocrSetValue(<object>)\n......................\n[0-0] 2024-05-26T04:17:52.356Z INFO @wdio/ocr-service:ocrGetElementPositionByText: We searched for the word "docs" and found one match "docs" with score "100%"\n'})}),"\n",(0,s.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,s.jsx)(n.h3,{id:"text",children:(0,s.jsx)(n.code,{children:"text"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," yes"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"The text you want to search for to click on."}),"\n",(0,s.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"value",children:(0,s.jsx)(n.code,{children:"value"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," yes"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Value to be added."}),"\n",(0,s.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"submitvalue",children:(0,s.jsx)(n.code,{children:"submitValue"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"false"})]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:'If the value also needs to be submitted into the input field. This means an "ENTER" will be send at the end of the string.'}),"\n",(0,s.jsx)(n.h4,{id:"example-2",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n submitValue: true,\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"clickduration",children:(0,s.jsx)(n.code,{children:"clickDuration"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"500"})," milliseconds"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:'This is the duration of the click. If you want you can also create a "long click" by increasing the time.'}),"\n",(0,s.jsx)(n.h4,{id:"example-3",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n clickDuration: 3000, // This is 3 seconds\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"contrast",children:(0,s.jsx)(n.code,{children:"contrast"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"0.25"})]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The higher the contrast, the darker the image and vice versa. This can help to find text in an image. It accepts values between ",(0,s.jsx)(n.code,{children:"-1"})," and ",(0,s.jsx)(n.code,{children:"1"}),"."]}),"\n",(0,s.jsx)(n.h4,{id:"example-4",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n contrast: 0.5,\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"haystack",children:(0,s.jsx)(n.code,{children:"haystack"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," ",(0,s.jsx)(n.code,{children:"WebdriverIO.Element | ChainablePromiseElement | Rectangle"})]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["This is the search area in the screen where the OCR needs to look for text. This can be an element or a rectangle containing ",(0,s.jsx)(n.code,{children:"x"}),", ",(0,s.jsx)(n.code,{children:"y"}),", ",(0,s.jsx)(n.code,{children:"width"})," and ",(0,s.jsx)(n.code,{children:"height"})]}),"\n",(0,s.jsx)(n.h4,{id:"example-5",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n haystack: $("elementSelector"),\n});\n\n// OR\nawait browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n haystack: await $("elementSelector"),\n});\n\n// OR\nawait browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n haystack: {\n x: 10,\n y: 50,\n width: 300,\n height: 75,\
1n },\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"language",children:(0,s.jsx)(n.code,{children:"language"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"string"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," No"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," ",(0,s.jsx)(n.code,{children:"eng"})]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The language that Tesseract will recognize. More info can be found ",(0,s.jsx)(n.a,{href:"https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions",children:"here"})," and the supported languages can be found ",(0,s.jsx)(n.a,{href:"https://github.com/webdriverio/visual-testing/blob/main/packages/ocr-service/src/utils/constants.ts",children:"here"}),"."]}),"\n",(0,s.jsx)(n.h4,{id:"example-6",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'import { SUPPORTED_OCR_LANGUAGES } from "@wdio/ocr-service";\nawait browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n // Use Dutch as a language\n language: SUPPORTED_OCR_LANGUAGES.DUTCH,\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"relativeposition",children:(0,s.jsx)(n.code,{children:"relativePosition"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"object"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["You can click on the screen relative to the matching element. This can be done based on relative pixels ",(0,s.jsx)(n.code,{children:"above"}),", ",(0,s.jsx)(n.code,{children:"right"}),", ",(0,s.jsx)(n.code,{children:"below"})," or ",(0,s.jsx)(n.code,{children:"left"})," from the matching element"]}),"\n",(0,s.jsxs)(n.admonition,{type:"note",children:[(0,s.jsx)(n.p,{children:"The following combinations are allowed"}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"single properties"}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"above"})," + ",(0,s.jsx)(n.code,{children:"left"})," or ",(0,s.jsx)(n.code,{children:"above"})," + ",(0,s.jsx)(n.code,{children:"right"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"below"})," + ",(0,s.jsx)(n.code,{children:"left"})," or ",(0,s.jsx)(n.code,{children:"below"})," + ",(0,s.jsx)(n.code,{children:"right"})]}),"\n"]}),(0,s.jsxs)(n.p,{children:["The following combinations are ",(0,s.jsx)(n.strong,{children:"NOT"})," allowed"]}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"above"})," plus ",(0,s.jsx)(n.code,{children:"below"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"left"})," plus ",(0,s.jsx)(n.code,{children:"right"})]}),"\n"]})]}),"\n",(0,s.jsx)(n.h4,{id:"relativepositionabove",children:(0,s.jsx)(n.code,{children:"relativePosition.above"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Click x pixels ",(0,s.jsx)(n.code,{children:"above"})," the matching element."]}),"\n",(0,s.jsx)(n.h5,{id:"example-7",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n relativePosition: {\n above: 100,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"relativepositionright",children:(0,s.jsx)(n.code,{children:"relativePosition.right"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Click x pixels ",(0,s.jsx)(n.code,{children:"right"})," from the matching element."]}),"\n",(0,s.jsx)(n.h5,{id:"example-8",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n relativePosition: {\n right: 100,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"relativepositionbelow",children:(0,s.jsx)(n.code,{children:"relativePosition.below"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Click x pixels ",(0,s.jsx)(n.code,{children:"below"})," the matching element."]}),"\n",(0,s.jsx)(n.h5,{id:"example-9",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n relativePosition: {\n below: 100,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"relativepositionleft",children:(0,s.jsx)(n.code,{children:"relativePosition.left"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Click x pixels ",(0,s.jsx)(n.code,{children:"left"})," from the matching element."]}),"\n",(0,s.jsx)(n.h5,{id:"example-10",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n relativePosition: {\n left: 100,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h3,{id:"fuzzyfindoptions",children:(0,s.jsx)(n.code,{children:"fuzzyFindOptions"})}),"\n",(0,s.jsx)(n.p,{children:"You can alter the fuzzy logic to find text with the following options. This might help find a better match"}),"\n",(0,s.jsx)(n.h4,{id:"fuzzyfindoptionsdistance",children:(0,s.jsx)(n.code,{children:"fuzzyFindOptions.distance"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," 100"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Determines how close the match must be to the fuzzy location (specified by location). An exact letter match which is distance characters away from the fuzzy location would score as a complete mismatch. A distance of 0 requires the match to be at the exact location specified. A distance of 1000 would require a perfect match to be within 800 characters of the location to be found using a threshold of 0.8."}),"\n",(0,s.jsx)(n.h5,{id:"example-11",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n fuzzyFindOptions: {\n distance: 20,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"fuzzyfindoptionslocation",children:(0,s.jsx)(n.code,{children:"fuzzyFindOptions.location"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," 0"]}
1),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Determines approximately where in the text is the pattern expected to be found."}),"\n",(0,s.jsx)(n.h5,{id:"example-12",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n fuzzyFindOptions: {\n location: 20,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"fuzzyfindoptionsthreshold",children:(0,s.jsx)(n.code,{children:"fuzzyFindOptions.threshold"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," 0.6"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"At what point does the matching algorithm give up. A threshold of 0 requires a perfect match (of both letters and location), a threshold of 1.0 would match anything."}),"\n",(0,s.jsx)(n.h5,{id:"example-13",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n fuzzyFindOptions: {\n threshold: 0.8,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"fuzzyfindoptionsiscasesensitive",children:(0,s.jsx)(n.code,{children:"fuzzyFindOptions.isCaseSensitive"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"boolean"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," false"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Whether the search should be case sensitive."}),"\n",(0,s.jsx)(n.h5,{id:"example-14",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n fuzzyFindOptions: {\n isCaseSensitive: true,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"fuzzyfindoptionsminmatchcharlength",children:(0,s.jsx)(n.code,{children:"fuzzyFindOptions.minMatchCharLength"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," 2"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Only the matches whose length exceeds this value will be returned. (For instance, if you want to ignore single character matches in the result, set it to 2)"}),"\n",(0,s.jsx)(n.h5,{id:"example-15",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n fuzzyFindOptions: {\n minMatchCharLength: 5,\n },\n});\n'})}),"\n",(0,s.jsx)(n.h4,{id:"fuzzyfindoptionsfindallmatches",children:(0,s.jsx)(n.code,{children:"fuzzyFindOptions.findAllMatches"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Type:"})," ",(0,s.jsx)(n.code,{children:"number"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Mandatory:"})," no"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Default:"})," false"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["When ",(0,s.jsx)(n.code,{children:"true"}),", the matching function will continue to the end of a search pattern even if a perfect match has already been located in the string."]}),"\n",(0,s.jsx)(n.h5,{id:"example-16",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:'await browser.ocrSetValue({\n text: "WebdriverIO",\n value: "The Value",\n fuzzyFindOptions: {\n findAllMatches: 100,\n },\n});\n'})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]);
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.