Best JavaScript code snippet using appium-xcuitest-driver
ios-controller.js
Source:ios-controller.js
...746 step2();747 }.bind(this));748};749iOSController.clickWebCoords = function (cb) {750 this.translateWebCoords(this.curWebCoords, function (coords) {751 this.clickCoords(coords, cb);752 }.bind(this));753};754iOSController.submit = function (elementId, cb) {755 if (this.isWebContext()) {756 this.useAtomsElement(elementId, cb, function (atomsElement) {757 this.executeAtom('submit', [atomsElement], cb);758 }.bind(this));759 } else {760 cb(new NotImplementedError(), null);761 }762};763iOSController.pressKeyCode = function (keycode, metastate, cb) {764 cb(new NotImplementedError(), null);765};766iOSController.longPressKeyCode = function (keycode, metastate, cb) {767 cb(new NotImplementedError(), null);768};769iOSController.keyevent = function (keycode, metastate, cb) {770 cb(new NotImplementedError(), null);771};772iOSController.complexTap = function (tapCount, touchCount, duration, x, y, elementId, cb) {773 var command;774 var options = {775 tapCount: tapCount776 , touchCount: touchCount777 , duration: duration778 , x: x779 , y: y780 };781 var JSONOpts = JSON.stringify(options);782 if (elementId !== null) {783 command = ["au.getElement('", elementId, "').complexTap(", JSONOpts, ')'].join('');784 } else {785 command = ["au.complexTap(", JSONOpts, ")"].join('');786 }787 this.proxy(command, cb);788};789iOSController.clear = function (elementId, cb) {790 if (this.isWebContext()) {791 this.useAtomsElement(elementId, cb, function (atomsElement) {792 this.executeAtom('clear', [atomsElement], cb);793 }.bind(this));794 } else {795 var command = ["au.getElement('", elementId, "').setValue('')"].join('');796 this.proxy(command, cb);797 }798};799iOSController.getText = function (elementId, cb) {800 if (this.isWebContext()) {801 this.useAtomsElement(elementId, cb, function (atomsElement) {802 this.executeAtom('get_text', [atomsElement], cb);803 }.bind(this));804 } else {805 var command = ["au.getElement('", elementId, "').text()"].join('');806 this.proxy(command, function (err, res) {807 // in some cases instruments returns in integer. we only want a string808 res.value = res.value ? res.value.toString() : '';809 cb(err, res);810 });811 }812};813iOSController.getName = function (elementId, cb) {814 if (this.isWebContext()) {815 this.useAtomsElement(elementId, cb, function (atomsElement) {816 var script = "return arguments[0].tagName.toLowerCase()";817 this.executeAtom('execute_script', [script, [atomsElement]], cb);818 }.bind(this));819 } else {820 var command = ["au.getElement('", elementId, "').type()"].join('');821 this.proxy(command, cb);822 }823};824iOSController.getAttribute = function (elementId, attributeName, cb) {825 if (this.isWebContext()) {826 var atomsElement = this.getAtomsElement(elementId);827 if (atomsElement === null) {828 cb(null, {829 status: status.codes.UnknownError.code830 , value: "Error converting element ID for using in WD atoms: " + elementId831 });832 } else {833 this.executeAtom('get_attribute_value', [atomsElement, attributeName], cb);834 }835 } else {836 if (_.contains(['label', 'name', 'value', 'values', 'hint'], attributeName)) {837 var command = ["au.getElement('", elementId, "').", attributeName, "()"].join('');838 this.proxy(command, cb);839 } else {840 cb(null, {841 status: status.codes.UnknownCommand.code842 , value: "UIAElements don't have the attribute '" + attributeName + "'"843 });844 }845 }846};847iOSController.getLocation = function (elementId, cb) {848 if (this.isWebContext()) {849 this.useAtomsElement(elementId, cb, function (atomsElement) {850 this.executeAtom('get_top_left_coordinates', [atomsElement], cb);851 }.bind(this));852 } else {853 var command = ["au.getElement('", elementId,854 "').getElementLocation()"].join('');855 this.proxy(command, cb);856 }857};858iOSController.getSize = function (elementId, cb) {859 if (this.isWebContext()) {860 var atomsElement = this.getAtomsElement(elementId);861 if (atomsElement === null) {862 cb(null, {863 status: status.codes.UnknownError.code864 , value: "Error converting element ID for using in WD atoms: " + elementId865 });866 } else {867 this.executeAtom('get_size', [atomsElement], cb);868 }869 } else {870 var command = ["au.getElement('", elementId, "').getElementSize()"].join('');871 this.proxy(command, cb);872 }873};874iOSController.getWindowSize = function (windowHandle, cb) {875 if (windowHandle !== "current") {876 cb(null, {877 status: status.codes.NoSuchWindow.code878 , value: "Currently only getting current window size is supported."879 });880 }881 if (this.isWebContext()) {882 this.executeAtom('get_window_size', [], function (err, res) {883 cb(null, {884 status: status.codes.Success.code885 , value: res886 });887 });888 } else {889 this.proxy("au.getWindowSize()", cb);890 }891};892iOSController.mobileWebNav = function (navType, cb) {893 this.remote.willNavigateWithoutReload = true;894 this.executeAtom('execute_script', ['history.' + navType + '();', null], cb);895};896iOSController.back = function (cb) {897 if (this.isWebContext()) {898 this.mobileWebNav("back", cb);899 } else {900 var command = "au.back();";901 this.proxy(command, cb);902 }903};904iOSController.forward = function (cb) {905 if (this.isWebContext()) {906 this.mobileWebNav("forward", cb);907 } else {908 cb(new NotImplementedError(), null);909 }910};911iOSController.refresh = function (cb) {912 if (this.isWebContext()) {913 this.executeAtom('refresh', [], cb);914 } else {915 cb(new NotImplementedError(), null);916 }917};918iOSController.getPageIndex = function (elementId, cb) {919 if (this.isWebContext()) {920 cb(new NotImplementedError(), null);921 } else {922 var command = ["au.getElement('", elementId, "').pageIndex()"].join('');923 this.proxy(command, cb);924 }925};926iOSController.keys = function (keys, cb) {927 keys = escapeSpecialChars(keys, "'");928 if (this.isWebContext()) {929 this.active(function (err, res) {930 if (err || typeof res.value.ELEMENT === "undefined") {931 return cb(err, res);932 }933 this.setValue(res.value.ELEMENT, keys, cb);934 }.bind(this));935 } else {936 var command = ["au.sendKeysToActiveElement('", keys, "')"].join('');937 this.proxy(command, cb);938 }939};940iOSController.frame = function (frame, cb) {941 if (this.isWebContext()) {942 var atom;943 if (frame === null) {944 this.curWebFrames = [];945 logger.debug("Leaving web frame and going back to default content");946 cb(null, {947 status: status.codes.Success.code948 , value: ''949 });950 } else {951 if (typeof frame.ELEMENT !== "undefined") {952 this.useAtomsElement(frame.ELEMENT, cb, function (atomsElement) {953 this.executeAtom('get_frame_window', [atomsElement], function (err, res) {954 if (this.checkSuccess(err, res, cb)) {955 logger.debug("Entering new web frame: " + res.value.WINDOW);956 this.curWebFrames.unshift(res.value.WINDOW);957 cb(err, res);958 }959 }.bind(this));960 }.bind(this));961 } else {962 atom = "frame_by_id_or_name";963 if (typeof frame === "number") {964 atom = "frame_by_index";965 }966 this.executeAtom(atom, [frame], function (err, res) {967 if (this.checkSuccess(err, res, cb)) {968 if (res.value === null || typeof res.value.WINDOW === "undefined") {969 cb(null, {970 status: status.codes.NoSuchFrame.code971 , value: ''972 });973 } else {974 logger.debug("Entering new web frame: " + res.value.WINDOW);975 this.curWebFrames.unshift(res.value.WINDOW);976 cb(err, res);977 }978 }979 }.bind(this));980 }981 }982 } else {983 frame = frame ? frame : 'target.frontMostApp()';984 var command = ["wd_frame = ", frame].join('');985 this.proxy(command, cb);986 }987};988iOSController.implicitWait = function (ms, cb) {989 this.implicitWaitMs = parseInt(ms, 10);990 logger.debug("Set iOS implicit wait to " + ms + "ms");991 cb(null, {992 status: status.codes.Success.code993 , value: null994 });995};996iOSController.asyncScriptTimeout = function (ms, cb) {997 this.asyncWaitMs = parseInt(ms, 10);998 logger.debug("Set iOS async script timeout to " + ms + "ms");999 cb(null, {1000 status: status.codes.Success.code1001 , value: null1002 });1003};1004iOSController.pageLoadTimeout = function (ms, cb) {1005 this.pageLoadMs = parseInt(ms, 10);1006 if (this.remote) this.remote.pageLoadMs = this.pageLoadMs;1007 logger.debug("Set iOS page load timeout to " + ms + "ms");1008 cb(null, {1009 status: status.codes.Success.code1010 , value: null1011 });1012};1013iOSController.elementDisplayed = function (elementId, cb) {1014 if (this.isWebContext()) {1015 this.useAtomsElement(elementId, cb, function (atomsElement) {1016 this.executeAtom('is_displayed', [atomsElement], cb);1017 }.bind(this));1018 } else {1019 var command = ["au.getElement('", elementId, "').isDisplayed()"].join('');1020 this.proxy(command, cb);1021 }1022};1023iOSController.elementEnabled = function (elementId, cb) {1024 if (this.isWebContext()) {1025 this.useAtomsElement(elementId, cb, function (atomsElement) {1026 this.executeAtom('is_enabled', [atomsElement], cb);1027 }.bind(this));1028 } else {1029 var command = ["au.getElement('", elementId, "').isEnabled() === 1"].join('');1030 this.proxy(command, cb);1031 }1032};1033iOSController.elementSelected = function (elementId, cb) {1034 if (this.isWebContext()) {1035 this.useAtomsElement(elementId, cb, function (atomsElement) {1036 this.executeAtom('is_selected', [atomsElement], cb);1037 }.bind(this));1038 } else {1039 var command = ["au.getElement('", elementId, "').isSelected()"].join('');1040 this.proxy(command, cb);1041 }1042};1043iOSController.getCssProperty = function (elementId, propertyName, cb) {1044 if (this.isWebContext()) {1045 this.useAtomsElement(elementId, cb, function (atomsElement) {1046 this.executeAtom('get_value_of_css_property', [atomsElement,1047 propertyName], cb);1048 }.bind(this));1049 } else {1050 cb(new NotImplementedError(), null);1051 }1052};1053iOSController.getPageSource = function (cb) {1054 if (this.isWebContext()) {1055 this.processingRemoteCmd = true;1056 var cmd = 'document.getElementsByTagName("html")[0].outerHTML';1057 this.remote.execute(cmd, function (err, res) {1058 if (err) {1059 cb("Remote debugger error", {1060 status: status.codes.UnknownError.code1061 , value: res1062 });1063 } else {1064 cb(null, {1065 status: status.codes.Success.code1066 , value: res.result.value1067 });1068 }1069 this.processingRemoteCmd = false;1070 }.bind(this));1071 } else {1072 this.getSourceForElementForXML(null, function (err, res) {1073 var xmlSource;1074 if (err || res.status !== 0) return cb(err, res);1075 try {1076 xmlSource = _xmlSourceFromJson(res.value);1077 } catch (e) {1078 return cb(e);1079 }1080 return cb(null, {1081 status: status.codes.Success.code1082 , value: xmlSource1083 });1084 }.bind(this));1085 }1086};1087iOSController.getAlertText = function (cb) {1088 this.proxy("au.getAlertText()", cb);1089};1090iOSController.setAlertText = function (text, cb) {1091 text = escapeSpecialChars(text, "'");1092 this.proxy("au.setAlertText('" + text + "')", cb);1093};1094iOSController.postAcceptAlert = function (cb) {1095 this.proxy("au.acceptAlert()", cb);1096};1097iOSController.postDismissAlert = function (cb) {1098 this.proxy("au.dismissAlert()", cb);1099};1100iOSController.lock = function (secs, cb) {1101 this.proxy(["au.lock(", secs, ")"].join(''), cb);1102};1103iOSController.isLocked = function (cb) {1104 cb(new NotYetImplementedError(), null);1105};1106iOSController.background = function (secs, cb) {1107 this.proxy(["au.background(", secs, ")"].join(''), cb);1108};1109iOSController.getOrientation = function (cb) {1110 this.proxy("au.getScreenOrientation()", function (err, res) {1111 if (res && res.status === status.codes.Success.code) {1112 // keep track of orientation for our own purposes1113 logger.debug("Setting internal orientation to " + res.value);1114 this.curOrientation = res.value;1115 }1116 cb(err, res);1117 });1118};1119iOSController.setOrientation = function (orientation, cb) {1120 var command = ["au.setScreenOrientation('", orientation, "')"].join('');1121 this.proxy(command, function (err, res) {1122 if (res && res.status === 0) {1123 this.curOrientation = orientation;1124 }1125 cb(err, res);1126 }.bind(this));1127};1128iOSController.getScreenshot = function (cb) {1129 var guid = uuid.create();1130 var command = ["au.capture('screenshot", guid, "')"].join('');1131 var shotFolder = path.resolve(this.args.tmpDir,1132 "appium-instruments/Run 1/");1133 if (!fs.existsSync(shotFolder)) {1134 mkdirp.sync(shotFolder);1135 }1136 var shotPath = path.resolve(shotFolder, 'screenshot' + guid + '.png');1137 // Retrying the whole screenshot process for three times.1138 async.retry(3,1139 function (cb) {1140 async.waterfall([1141 function (cb) { this.getOrientation(function () { cb(); }); }.bind(this),1142 function (cb) { this.proxy(command, cb); }.bind(this),1143 function (response, cb) {1144 var data;1145 var screenshotWaitTimeout = (this.args.screenshotWaitTimeout || 10) * 1000;1146 logger.debug('Waiting ' + screenshotWaitTimeout + ' ms for screenshot to ge generated.');1147 var startMs = Date.now();1148 var lastErr;1149 async.until(1150 function () { return data || Date.now() - startMs > screenshotWaitTimeout; },1151 function (cb) {1152 setTimeout(function () {1153 fs.readFile(shotPath, function (err, _data) {1154 lastErr = err;1155 if (!err) { data = _data; }1156 cb();1157 });1158 }, 300);1159 },1160 function (err) {1161 if (!data) {1162 return cb(new Error("Timed out waiting for screenshot file. " + (lastErr || '').toString()));1163 }1164 cb(err, response, data);1165 }1166 );1167 }.bind(this),1168 function (response, data, cb) {1169 // rotate if necessary1170 if (this.curOrientation === "LANDSCAPE") {1171 // need to rotate 90 deg CC1172 logger.debug("Rotating landscape screenshot");1173 rotateImage(shotPath, -90, function (err) {1174 if (err) return cb(new Error("Could not rotate screenshot appropriately"), null);1175 fs.readFile(shotPath, function read(err, _data) {1176 if (err) return cb(new Error("Could not retrieve screenshot file following rotate. " + err.toString()));1177 cb(null, response, _data);1178 });1179 });1180 } else cb(null, response, data);1181 }.bind(this),1182 function (response, data, cb) {1183 var b64data = new Buffer(data).toString('base64');1184 response.value = b64data;1185 cb(null, response);1186 }1187 ], cb);1188 }.bind(this), cb);1189};1190iOSController.fakeFlick = function (xSpeed, ySpeed, swipe, cb) {1191 var command = "";1192 if (swipe) {1193 command = ["au.touchSwipeFromSpeed(", xSpeed, ",", ySpeed, ")"].join('');1194 this.proxy(command, cb);1195 } else {1196 command = ["au.touchFlickFromSpeed(", xSpeed, ",", ySpeed, ")"].join('');1197 this.proxyWithMinTime(command, FLICK_MS, cb);1198 }1199};1200iOSController.fakeFlickElement = function (elementId, xoffset, yoffset, speed, cb) {1201 var command = "";1202 if (this.isWebContext()) {1203 this.useAtomsElement(elementId, cb, function (atomsElement) {1204 this.executeAtom('get_top_left_coordinates', [atomsElement], function (err, res) {1205 if (err || res.status !== 0) return cb(err, res);1206 var x = res.value.x, y = res.value.y;1207 this.executeAtom('get_size', [atomsElement], function (err, res) {1208 if (err || res.status !== 0) return cb(err, res);1209 var w = res.value.width, h = res.value.height;1210 var clickX = x + (w / 2);1211 var clickY = y + (h / 2);1212 this.translateWebCoords({x: clickX, y: clickY}, function (from) {1213 this.translateWebCoords({x: clickX + xoffset, y: clickY + yoffset}, function (to) {1214 // speed is not used because underlying UIATarget.flickFromTo doesn't support it1215 command = ["au.flick(", JSON.stringify({from: from, to: to}), ")"].join('');1216 this.proxy(command, cb);1217 }.bind(this));1218 }.bind(this));1219 }.bind(this));1220 }.bind(this));1221 }.bind(this));1222 } else {1223 command = ["au.getElement('", elementId, "').touchFlick(", xoffset, ",",1224 yoffset, ",", speed, ")"].join('');1225 this.proxyWithMinTime(command, FLICK_MS, cb);1226 }1227};...
web.js
Source:web.js
...174 let {width, height} = await this.executeAtom('get_size', [atomsElement]);175 // translate to proper coordinates176 x = x + (width / 2);177 y = y + (height / 2);178 let from = await this.translateWebCoords({x, y});179 let to = await this.translateWebCoords({x: x + xoffset, y: y + yoffset});180 let args = {from, to};181 let command = `au.flick(${JSON.stringify(args)})`;182 await this.uiAutoClient.sendCommand(command);183};184extensions.mobileWebNav = async function (navType) {185 this.remote.allowNavigationWithoutReload();186 await this.executeAtom('execute_script', [`history.${navType}();`, null]);187};188extensions.nativeWebTap = async function (el) {189 let atomsElement = this.useAtomsElement(el);190 let {x, y} = await this.executeAtom('get_top_left_coordinates', [atomsElement]);191 let {width, height} = await this.executeAtom('get_size', [atomsElement]);192 x = x + (width / 2);193 y = y + (height / 2);194 this.curWebCoords = {x, y};195 await this.clickWebCoords();196 // make sure real tap actually has time to register197 await B.delay(500);198};199extensions.clickWebCoords = async function () {200 let coords = await this.translateWebCoords(this.curWebCoords);201 await this.clickCoords(coords);202};203extensions.translateWebCoords = async function (coords) {204 logger.debug(`Translating coordinates (${JSON.stringify(coords)}) to web coordinates`);205 let wvCmd = 'au.getElementsByType(\'webview\')';206 let webviewIndex = this.webContextIndex();207 // add static offset for safari in landscape mode208 let yOffset = this.curOrientation === 'LANDSCAPE' ? this.landscapeWebCoordsOffset : 0;209 // absolutize web coords210 let webviews = await this.uiAutoClient.sendCommand(wvCmd);211 if (webviews.length < 1) {212 throw new errors.UnknownError.code('Could not find any webviews to click inside!');213 }214 if (_.isUndefined(webviews[webviewIndex])) {...
Using AI Code Generation
1var path = require('path');2var wd = require('wd');3var chai = require('chai');4var chaiAsPromised = require('chai-as-promised');5chai.use(chaiAsPromised);6var expect = chai.expect;7var assert = chai.assert;8chaiAsPromised.transferPromiseness = wd.transferPromiseness;9var desiredCaps = {10 "app": path.resolve('/Users/username/Desktop/ios-apps/UICatalog.app'),11};12var driver = wd.promiseChainRemote("localhost", 4723);13driver.init(desiredCaps).then(function () {14 driver.setImplicitWaitTimeout(5000);15 driver.elementByName("Buttons").click().then(function () {16 driver.elementByName("Rounded").click().then(function () {17 driver.elementByName("Rounded").getLocation().then(function (loc) {18 driver.elementByName("Rounded").getSize().then(function (size) {19 var x = loc.x + size.width / 2;20 var y = loc.y + size.height / 2;21 driver.execute("mobile: tap", { "tapCount": 1, "touchCount": 1, "duration": 0.5, "x": x, "y": y }).then(function () {22 driver.elementByName("OK").click().then(function () {23 driver.quit();24 });25 });26 });27 });28 });29 });30});31- (id)handleTap:(FBRouteRequest *)request32{33 CGPoint tapPoint = CGPointMake(0, 0);34 if (request.arguments[@"x"] && request.arguments[@"y"]) {35 tapPoint = [self translateWebCoords:request.arguments[@"x"] y:request.arguments[@"y"]];36 }37 NSUInteger tapCount = [request.arguments[@"tapCount"] unsignedIntegerValue] ?: 1;38 NSUInteger touchCount = [request.arguments[@"touchCount"] unsignedIntegerValue] ?: 1;
Using AI Code Generation
1const { remote } = require('webdriverio');2const opts = {3 capabilities: {4 }5};6(async () => {7 const client = await remote(opts);8 const element = await client.$('~1');9 const location = await element.getLocation();10 const size = await element.getSize();11 console.log(location);12 console.log(size);13 const x = location.x + size.width/2;14 const y = location.y + size.height/2;15 console.log(x);16 console.log(y);17 const translated = await client.execute('mobile: translateWebCoords', {x: x, y: y});18 console.log(translated);19 await client.touchPerform([{20 options: {21 }22 }, {23 }]);24 await client.deleteSession();25})();26const { remote } = require('webdriverio');27const opts = {28 capabilities: {29 }30};31(async () => {32 const client = await remote(opts);33 const element = await client.$('~1');34 const location = await element.getLocation();35 const size = await element.getSize();36 console.log(location);37 console.log(size);38 const x = location.x + size.width/2;39 const y = location.y + size.height/2;40 console.log(x);41 console.log(y);42 const translated = await client.execute('mobile: translateWebCoords', {x: x, y: y});
Using AI Code Generation
1const { remote } = require('webdriverio');2const { appium } = require('appium');3const opts = {4 capabilities: {5 }6};7(async () => {8 let client = await remote(opts);9 let { x, y } = await client.translateWebCoords(100, 200);10 console.log(x, y);11 await client.deleteSession();12})();13const { remote } = require('webdriverio');14const { appium } = require('appium');15const opts = {16 capabilities: {17 }18};19(async () => {20 let client = await remote(opts);21 let { x, y } = await client.translateWebCoords(100, 200);22 console.log(x, y);23 await client.deleteSession();24})();25const { remote } = require('webdriverio');26const { appium } = require('appium');27const opts = {28 capabilities: {29 }30};31(async () => {32 let client = await remote(opts);33 let { x, y } = await client.translateWebCoords(100, 200);34 console.log(x, y);35 await client.deleteSession();36})();
Using AI Code Generation
1const { remote } = require('webdriverio');2const { XCUITestDriver } = require('appium-xcuitest-driver');3const { startServer } = require('appium');4const { translateWebCoords } = require('appium-xcuitest-driver/build/lib/webcoordutils');5(async () => {6 const appium = await startServer({7 });8 const driver = await remote({9 capabilities: {10 }11 });12 const webCoords = await translateWebCoords(driver, {x: 100, y: 200});13 console.log(webCoords);14 await driver.deleteSession();15 await appium.close();16})();
Using AI Code Generation
1const wd = require('wd');2const {execSync} = require('child_process');3const assert = require('assert');4const {exec} = require('child_process');5const {execFile} = require('child_process');6const {execFileSync} = require('child_process');7const {execSync} = require('child_process');8const {execFileSync} = requi
Using AI Code Generation
1const wd = require('wd');2const chai = require('chai');3const chaiAsPromised = require('chai-as-promised');4chai.use(chaiAsPromised);5chai.should();6chaiAsPromised.transferPromiseness = wd.transferPromiseness;7describe('Test Web', function () {8 this.timeout(300000);9 let driver;10 before(async function () {11 driver = await wd.promiseChainRemote('localhost', 4723);12 await driver.init({13 });14 });15 after(async function () {16 await driver.quit();17 });18 it('should click on the web element', async function () {19 let webview = await driver.elementByClassName('XCUIElementTypeWebView');20 await driver.context(webview.value);21 let location = await driver.getLocation(input);22 let size = await driver.getSize(input);23 let x = location.x + (size.width / 2);24 let y = location.y + (size.height / 2);25 let webCoords = {x, y};26 let nativeCoords = await driver.execute('mobile: translateWebCoords', {x: webCoords.x, y: webCoords.y});27 await driver.tap(nativeCoords.x, nativeCoords.y);28 await driver.context('NATIVE_APP');29 });30});31const wd = require('wd');32const chai = require('chai');33const chaiAsPromised = require('chai-as-promised');34chai.use(chaiAsPromised);35chai.should();36chaiAsPromised.transferPromiseness = wd.transferPromiseness;37describe('Test Web', function () {38 this.timeout(300000);39 let driver;40 before(async function () {41 driver = await wd.promiseChainRemote('localhost', 4723);42 await driver.init({
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!