How to use decode_value_from_wire method in AutoItDriverServer

Best Python code snippet using AutoItDriverServer_python

server.py

Source:server.py Github

copy

Full Screen

...183 return app_response184@app.route('/wd/hub/session/<session_id>/element/<element_id>/click', method='POST')185def element_click(session_id='', element_id=''):186 try:187 element = decode_value_from_wire(element_id)188 #result = autoit.control_click("[active]", element)189 result = app.oAutoItX.ControlClick("[active]", "", element)190 if result == 0:191 raise Exception("AutoIt failed to click element %s." % element)192 except:193 response.status = 400194 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}195 app_response = {'sessionId': session_id,196 'status': 0,197 'value': {}}198 return app_response199@app.route('/wd/hub/session/<session_id>/click', method='POST')200def mouse_click(session_id=''):201 request_data = request.body.read()202 if request_data == None or request_data == '' or request_data == "{}":203 button = 0204 else:205 button = json.loads(request_data.decode()).get('button')206 try:207 if button == 1:208 btn_type = "middle"209 elif button == 2:210 btn_type = "right"211 else:212 btn_type = "left"213 #autoit.mouse_click(btn_type)214 app.oAutoItX.MouseClick(btn_type)215 except:216 response.status = 400217 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[0])}218 app_response = {'sessionId': session_id,219 'status': 0,220 'value': {}}221 return app_response222@app.route('/wd/hub/session/<session_id>/doubleclick', method='POST')223def double_click(session_id=''):224 try:225 #src = autoit.mouse_get_pos()226 #autoit.mouse_click("left",src.x,src.y,2)227 x = app.oAutoItX.MouseGetPosX()228 y = app.oAutoItX.MouseGetPosY()229 app.oAutoItX.MouseClick("left",x,y,2)230 except:231 response.status = 400232 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[0])}233 app_response = {'sessionId': session_id,234 'status': 0,235 'value': {}}236 return app_response237@app.route('/wd/hub/session/<session_id>/buttonup', method='POST')238def mouse_up(session_id=''):239 request_data = request.body.read()240 if request_data == None or request_data == '' or request_data == "{}":241 button = 0242 else:243 button = json.loads(request_data.decode()).get('button')244 try:245 if button == 1:246 btn_type = "middle"247 elif button == 2:248 btn_type = "right"249 else:250 btn_type = "left"251 #autoit.mouse_up(btn_type)252 app.oAutoItX.MouseUp(btn_type)253 except:254 response.status = 400255 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[0])}256 app_response = {'sessionId': session_id,257 'status': 0,258 'value': {}}259 return app_response260@app.route('/wd/hub/session/<session_id>/buttondown', method='POST')261def mouse_down(session_id=''):262 request_data = request.body.read()263 if request_data == None or request_data == '' or request_data == "{}":264 button = 0265 else:266 button = json.loads(request_data.decode()).get('button')267 try:268 if button == 1:269 btn_type = "middle"270 elif button == 2:271 btn_type = "right"272 else:273 btn_type = "left"274 #autoit.mouse_down(btn_type)275 app.oAutoItX.MouseDown(btn_type)276 except:277 response.status = 400278 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[0])}279 app_response = {'sessionId': session_id,280 'status': 0,281 'value': {}}282 return app_response283@app.route('/wd/hub/session/<session_id>/moveto', method='POST')284def move_to(session_id=''):285 request_data = request.body.read()286 if request_data == None or request_data == '' or request_data == "{}":287 element_id = None288 xoffset = None289 yoffset = None290 else:291 element_id = json.loads(request_data.decode()).get('element')292 xoffset = json.loads(request_data.decode()).get('xoffset')293 yoffset = json.loads(request_data.decode()).get('yoffset')294 try:295 if element_id == None and (xoffset != None or yoffset != None):296 #src = autoit.mouse_get_pos() 297 #autoit.mouse_move(src.x+xoffset,src.y+yoffset)298 x = app.oAutoItX.MouseGetPosX()299 y = app.oAutoItX.MouseGetPosY()300 app.oAutoItX.MouseMove(x+xoffset,y+yoffset)301 else:302 if xoffset != None or yoffset != None:303 control_id = decode_value_from_wire(element_id)304 #pos = autoit.control_get_pos("[active]",control_id) 305 x = app.oAutoItX.ControlGetPosX("[active]","",control_id)306 y = app.oAutoItX.ControlGetPosY("[active]","",control_id)307 #if autoit._has_error():308 if app.oAutoItX.error == 1:309 raise Exception("AutoIt failed to get element %s location to move to." % control_id)310 #autoit.mouse_move(pos.left+xoffset,pos.top+yoffset)311 app.oAutoItX.MouseMove(x+xoffset,y+yoffset)312 else: # just go to center of element313 control_id = decode_value_from_wire(element_id)314 #pos = autoit.control_get_pos("[active]",control_id) 315 x = app.oAutoItX.ControlGetPosX("[active]","",control_id)316 y = app.oAutoItX.ControlGetPosY("[active]","",control_id)317 width = app.oAutoItX.ControlGetPosWidth("[active]","",control_id)318 height = app.oAutoItX.ControlGetPosHeight("[active]","",control_id)319 #if autoit._has_error():320 if app.oAutoItX.error == 1:321 raise Exception("AutoIt failed to get element %s location to move to." % control_id)322 #autoit.mouse_move(pos.left+(pos.right/2),pos.top+(pos.bottom/2))323 app.oAutoItX.MouseMove(x+(width/2),y+(height/2))324 except:325 response.status = 400326 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}327 app_response = {'sessionId': session_id,328 'status': 0,329 'value': {}}330 return app_response331@app.route('/wd/hub/session/<session_id>/element/<element_id>/value', method='POST')332def set_value(session_id='', element_id=''):333 request_data = request.body.read()334 try:335 value_to_set = json.loads(request_data.decode()).get('value')336 value_to_set = ''.join(value_to_set)337 control_id = decode_value_from_wire(element_id)338 #result = autoit.control_set_text("[active]",control_id,value_to_set)339 result = app.oAutoItX.ControlSetText("[active]","",control_id,value_to_set)340 if result == 0:341 raise Exception("AutoIt failed to set text of element %s, element or window not found." % control_id)342 except:343 response.status = 400344 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}345 app_response = {'sessionId': session_id,346 'status': 0,347 'value': {}}348 return app_response349@app.route('/wd/hub/session/<session_id>/element/<element_id>/clear', method='POST')350def clear(session_id='', element_id=''):351 try:352 control_id = decode_value_from_wire(element_id)353 #result = autoit.control_set_text("[active]",control_id,"")354 result = app.oAutoItX.ControlSetText("[active]","",control_id,"")355 if result == 0:356 raise Exception("AutoIt failed to clear text of element %s, element or window not found." % control_id)357 except:358 response.status = 400359 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}360 app_response = {'sessionId': session_id,361 'status': 0,362 'value': {}}363 return app_response364@app.route('/wd/hub/session/<session_id>/element/<element_id>/element', method='POST')365def element_find_element(session_id='', element_id=''):366 return _find_element(session_id, element_id)367@app.route('/wd/hub/session/<session_id>/element', method='POST')368def find_element(session_id=''):369 return _find_element(session_id, "root")370def _find_element(session_id, context, many=False):371 try:372 json_request_data = json.loads(request.body.read().decode())373 locator_strategy = json_request_data.get('using')374 value = json_request_data.get('value')375 if locator_strategy == "id":376 control_id = "[ID:%s]" % value377 elif locator_strategy == "link text":378 control_id = "[TEXT:%s]" % value379 elif locator_strategy == "tag name":380 control_id = "[CLASS:%s]" % value381 elif locator_strategy == "class name":382 control_id = "[CLASSNN:%s]" % value383 elif locator_strategy == "name":384 control_id = "[NAME:%s]" % value385 elif locator_strategy == "xpath":386 control_id = "[REGEXPCLASS:%s]" % value387 elif locator_strategy == "css selector":388 control_id = value389 else:390 control_id = value391 # AutoIt has no concept of finding elements/controls and checking if it392 # exists or not. Therefore, we just pass back the location strategy value393 # and let the individual WebElement methods fail when control/element not found394 found_elements = {'ELEMENT':encode_value_4_wire(control_id)} 395 return {'sessionId': session_id, 'status': 0, 'value': found_elements}396 except:397 response.status = 400398 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[0])}399@app.route('/wd/hub/session/<session_id>/keys', method='POST')400def keys(session_id=''):401 try:402 request_data = request.body.read()403 wired_keys = json.loads(request_data.decode()).get('value')404 keys = "".join(wired_keys)405 #autoit.send(keys)406 app.oAutoItX.Send(keys)407 return {'sessionId': session_id, 'status': 0}408 except:409 response.status = 400410 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[0])}411@app.route('/wd/hub/session/<session_id>/element/<element_id>/location', method='GET')412def element_location(session_id='', element_id=''):413 try:414 control_id = decode_value_from_wire(element_id)415 #pos = autoit.control_get_pos("[active]",control_id)416 #location = {'x': pos.left, 'y': pos.top}417 x = app.oAutoItX.ControlGetPosX("[active]","",control_id)418 y = app.oAutoItX.ControlGetPosY("[active]","",control_id)419 location = {'x': x, 'y': y}420 #if autoit._has_error():421 if app.oAutoItX.error == 1:422 raise Exception("AutoIt failed to get element %s location coordinates." % control_id)423 return {'sessionId': session_id, 'status': 0, 'value': location}424 except:425 response.status = 400426 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}427 428@app.route('/wd/hub/session/<session_id>/element/<element_id>/size', method='GET')429def element_size(session_id='', element_id=''):430 try:431 control_id = decode_value_from_wire(element_id)432 #pos = autoit.control_get_pos("[active]",control_id)433 #size = {'width': pos.right, 'height': pos.bottom}434 width = app.oAutoItX.ControlGetPosWidth("[active]","",control_id)435 height = app.oAutoItX.ControlGetPosWidth("[active]","",control_id)436 size = {'width': width, 'height': height}437 #if autoit._has_error():438 if app.oAutoItX.error == 1:439 raise Exception("AutoIt failed to get element %s width & height size." % control_id)440 return {'sessionId': session_id, 'status': 0, 'value': size}441 except:442 response.status = 400443 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}444@app.route('/wd/hub/session/<session_id>/element/<element_id>/displayed', method='GET')445def element_displayed(session_id='', element_id=''):446 try:447 control_id = decode_value_from_wire(element_id)448 #result = autoit.control_command("[active]",control_id,"IsVisible")449 result = app.oAutoItX.ControlCommand("[active]","",control_id,"IsVisible")450 displayed = True if result == 1 else False451 #if autoit._has_error():452 if app.oAutoItX.error == 1:453 raise Exception("AutoIt failed to find element %s." % control_id)454 return {'sessionId': session_id, 'status': 0, 'value': displayed}455 except:456 response.status = 400457 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}458@app.route('/wd/hub/session/<session_id>/element/<element_id>/enabled', method='GET')459def element_enabled(session_id='', element_id=''):460 try:461 control_id = decode_value_from_wire(element_id)462 #result = autoit.control_command("[active]",control_id,"IsEnabled")463 result = app.oAutoItX.ControlCommand("[active]","",control_id,"IsEnabled")464 enabled = True if result == 1 else False465 #if autoit._has_error():466 if app.oAutoItX.error == 1:467 raise Exception("AutoIt failed to find element %s." % control_id)468 return {'sessionId': session_id, 'status': 0, 'value': enabled}469 except:470 response.status = 400471 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}472@app.route('/wd/hub/session/<session_id>/element/<element_id>/selected', method='GET')473def element_selected(session_id='', element_id=''):474 try:475 control_id = decode_value_from_wire(element_id)476 #result = autoit.control_command("[active]",control_id,"IsChecked")477 result = app.oAutoItX.ControlCommand("[active]","",control_id,"IsChecked")478 selected = True if result == 1 else False479 #if autoit._has_error():480 if app.oAutoItX.error == 1:481 raise Exception("AutoIt failed to find element %s." % control_id)482 return {'sessionId': session_id, 'status': 0, 'value': selected}483 except:484 response.status = 400485 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}486@app.route('/wd/hub/session/<session_id>/element/<element_id>/text', method='GET')487def get_text(session_id='', element_id=''):488 try:489 control_id = decode_value_from_wire(element_id)490 #text = autoit.control_get_text("[active]",control_id)491 text = app.oAutoItX.ControlGetText("[active]","",control_id)492 #if autoit._has_error() and text == "":493 if app.oAutoItX.error == 1 and text == "":494 raise Exception("AutoIt failed to find element %s, and get it's text" % control_id)495 except:496 response.status = 400497 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}498 app_response = {'sessionId': session_id,499 'status': 0,500 'value': text}501 return app_response502@app.route('/wd/hub/session/<session_id>/element/<element_id>/attribute/<attribute>', method='GET')503def get_attribute(session_id='', element_id='', attribute=''):504 try:505 control_id = decode_value_from_wire(element_id)506 #result = autoit.control_command("[active]",control_id,attribute)507 result = app.oAutoItX.ControlCommand("[active]","",control_id,attribute)508 #if autoit._has_error():509 if app.oAutoItX.error == 1:510 raise Exception("AutoIt failed to find element %s or extract the specified attribute/command '%s'." % (control_id,attribute))511 except:512 response.status = 400513 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}514 app_response = {'sessionId': session_id,515 'status': 0,516 'value': str(result)}517 return app_response518@app.route('/wd/hub/session/<session_id>/element/<element_id>/css/<property_name>', method='GET')519def get_property(session_id='', element_id='', property_name=''):520 try:521 control_id = decode_value_from_wire(element_id)522 #result = autoit.control_command("[active]",control_id,property_name)523 result = app.oAutoItX.ControlCommand("[active]","",control_id,property_name)524 #if autoit._has_error():525 if app.oAutoItX.error == 1:526 raise Exception("AutoIt failed to find element %s or extract the specified property/command '%s'." % (control_id,property_name))527 except:528 response.status = 400529 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}530 app_response = {'sessionId': session_id,531 'status': 0,532 'value': str(result)}533 return app_response534@app.route('/wd/hub/session/<session_id>/title', method='GET')535def get_window_title(session_id=''):536 try:537 #text = autoit.win_get_title("[active]")538 text = app.oAutoItX.WinGetTitle("[active]")539 if text == 0:540 raise Exception("AutoIt failed to get window title of current window.") 541 except:542 response.status = 400543 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[1])}544 app_response = {'sessionId': session_id,545 'status': 0,546 'value': text}547 return app_response548@app.route('/wd/hub/session/<session_id>/window_handle', method='GET')549def get_current_window_handle(session_id=''):550 try:551 #handle = autoit.win_get_handle("[active]")552 handle = app.oAutoItX.WinGetHandle("[active]")553 #if autoit._has_error() and handle == "":554 if app.oAutoItX.error == 1 and handle == "":555 raise Exception("AutoIt failed to get current window handle.")556 except:557 response.status = 400558 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[1])}559 app_response = {'sessionId': session_id,560 'status': 0,561 'value': handle}562 return app_response563@app.route('/wd/hub/session/<session_id>/window', method='POST')564def select_window(session_id=''):565 request_data = request.body.read()566 try:567 win_name_or_handle = json.loads(request_data.decode()).get('name')568 #try:569 #autoit.win_activate_by_handle(win_name_or_handle)570 #except:571 #autoit.win_activate(win_name_or_handle)572 app.oAutoItX.WinActivate(win_name_or_handle)573 except:574 response.status = 400575 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[0])}576 app_response = {'sessionId': session_id,577 'status': 0,578 'value': {}}579 return app_response580@app.route('/wd/hub/session/<session_id>/window', method='DELETE')581def close_window(session_id=''):582 try:583 #autoit.win_close("[active]")584 app.oAutoItX.WinClose("[active]")585 except:586 response.status = 400587 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[0])}588 app_response = {'sessionId': session_id,589 'status': 0,590 'value': {}}591 return app_response592@app.route('/wd/hub/session/<session_id>/window/<window_handle>/size', method='POST')593def resize_window(session_id='', window_handle=''):594 try:595 request_data = request.body.read()596 width = json.loads(request_data.decode()).get('width')597 height = json.loads(request_data.decode()).get('height')598 if window_handle == "current":599 window = "[active]"600 #pos = autoit.win_get_pos(window)601 #if autoit._has_error():602 #raise Exception("Window handle %s not found for resizing." % window_handle)603 #autoit.win_move(window,pos.left,pos.top,width,height)604 else:605 window = window_handle606 #pos = autoit.win_get_pos_by_handle(window)607 #if autoit._has_error():608 #raise Exception("Window handle %s not found for resizing." % window_handle)609 #autoit.win_move_by_handle(window,pos.left,pos.top,width,height)610 611 x = app.oAutoItX.WinGetPosX(window)612 y = app.oAutoItX.WinGetPosX(window)613 if app.oAutoItX.error == 1:614 raise Exception("Window handle %s not found for resizing." % window_handle)615 app.oAutoItX.WinMove(window,x,y,width,height)616 except:617 response.status = 400618 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[1])}619 app_response = {'sessionId': session_id,620 'status': 0,621 'value': {}}622 return app_response623@app.route('/wd/hub/session/<session_id>/window/<window_handle>/size', method='GET')624def get_window_size(session_id='', window_handle=''):625 try:626 if window_handle == "current":627 window = "[active]"628 #pos = autoit.win_get_pos(window)629 else:630 window = window_handle631 #pos = autoit.win_get_pos_by_handle(window)632 #size = {'width': pos.right, 'height': pos.bottom}633 width = app.oAutoItX.WinGetPosWidth(window)634 height = app.oAutoItX.WinGetPosHeight(window)635 size = {'width': width, 'height': height}636 #if autoit._has_error():637 if app.oAutoItX.error == 1:638 raise Exception("Window handle %s not found for getting window size." % window_handle) 639 except:640 response.status = 400641 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[1])}642 app_response = {'sessionId': session_id,643 'status': 0,644 'value': size}645 return app_response646@app.route('/wd/hub/session/<session_id>/window/<window_handle>/position', method='POST')647def move_window(session_id='', window_handle=''):648 try:649 request_data = request.body.read()650 x = json.loads(request_data.decode()).get('x')651 y = json.loads(request_data.decode()).get('y')652 if window_handle == "current":653 window = "[active]"654 #autoit.win_move(window,x,y)655 else:656 window = window_handle657 #autoit.win_move_by_handle(window,x,y)658 659 app.oAutoItX.WinMove(window,x,y)660 except:661 response.status = 400662 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[0])}663 app_response = {'sessionId': session_id,664 'status': 0,665 'value': {}}666 return app_response667@app.route('/wd/hub/session/<session_id>/window/<window_handle>/position', method='GET')668def get_window_position(session_id='', window_handle=''):669 try:670 if window_handle == "current":671 window = "[active]"672 #pos = autoit.win_get_pos(window)673 else:674 window = window_handle675 #pos = autoit.win_get_pos_by_handle(window)676 677 #size = {'x': pos.left, 'y': pos.top}678 x = app.oAutoItX.WinGetPosX(window)679 y = app.oAutoItX.WinGetPosY(window)680 size = {'x': x, 'y': y}681 #if autoit._has_error():682 if app.oAutoItX.error == 1:683 raise Exception("Window handle %s not found for getting window position." % window_handle) 684 except:685 response.status = 400686 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[1])}687 app_response = {'sessionId': session_id,688 'status': 0,689 'value': size}690 return app_response691@app.route('/wd/hub/session/<session_id>/window/<window_handle>/maximize', method='POST')692def max_window(session_id='', window_handle=''):693 try:694 if window_handle == "current":695 window = "[active]"696 #pos = autoit.win_set_state(window,autoit.properties.SW_MAXIMIZE)697 else:698 window = window_handle699 #pos = autoit.win_set_state_by_handle(window,autoit.properties.SW_MAXIMIZE)700 701 # FYI, @SW_MAXIMIZE = 3, per https://github.com/jacexh/pyautoit/blob/master/autoit/autoit.py#L111702 app.oAutoItX.WinSetState(window,app.oAutoItX.SW_MAXIMIZE)703 except:704 response.status = 400705 return {'sessionId': session_id, 'status': 23, 'value': str(sys.exc_info()[0])}706 app_response = {'sessionId': session_id,707 'status': 0,708 'value': {}}709 return app_response710@app.route('/wd/hub/session/<session_id>/url', method='POST')711def run_autoit_app(session_id=''):712 try:713 request_data = request.body.read()714 app2run = json.loads(request_data.decode()).get('url')715 #autoit.run(app2run)716 app.oAutoItX.Run(app2run)717 #if autoit._has_error():718 if app.oAutoItX.error == 1:719 raise Exception("Failed to run the application/executable: %s." % app2run)720 except:721 response.status = 400722 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[1])}723 app_response = {'sessionId': session_id,724 'status': 0,725 'value': {}}726 return app_response727@app.route('/wd/hub/session/<session_id>/file', method='POST')728def upload_file(session_id=''):729 try:730 request_data = request.body.read()731 b64data = json.loads(request_data.decode()).get('file')732 byteContent = base64.b64decode(b64data)733 path = ""734 with tempfile.NamedTemporaryFile(delete=False) as f:735 f.write(byteContent)736 path = f.name737 extracted_files = unzip(path,os.path.dirname(path)) 738 except:739 response.status = 400740 return {'sessionId': session_id, 'status': 13, 'value': str(sys.exc_info()[0])}741 # For (remote) file uploads - well currently AutoItDriverServer will always be "remote"742 # we can't formally/technically support multiple file uploads yet, due to Selenium issue 2239743 # as the WebDriver/JSONWireProtocol spec doesn't define how to handle request/response744 # of multiple files uploaded. Therefore, we assume user upload single file for now745 result = "".join(extracted_files)746 app_response = {'sessionId': session_id,747 'status': 0,748 'value': result}749 return app_response750def unzip(source_filename, dest_dir):751 import zipfile,os.path752 files_in_zip = []753 with zipfile.ZipFile(source_filename) as zf: 754 for member in zf.infolist():755 words = member.filename.split('/')756 path = dest_dir757 for word in words[:-1]:758 drive, word = os.path.splitdrive(word)759 head, word = os.path.split(word)760 if word in (os.curdir, os.pardir, ''): continue761 path = os.path.join(path, word)762 zf.extract(member, path)763 unzipped_file = os.path.join(dest_dir,member.filename)764 print("Unzipped a file: ",unzipped_file)765 files_in_zip.append(unzipped_file)766 return files_in_zip767@app.error(404)768def unsupported_command(error):769 response.content_type = 'text/plain'770 return 'Unrecognized command, or AutoItDriverServer does not support/implement this: %s %s' % (request.method, request.path)771def encode_value_4_wire(value):772 try:773 return urllib.parse.quote(base64.b64encode(value.encode("utf-8")))774 except:775 return urllib.quote(base64.b64encode(value.encode("utf-8")))776def decode_value_from_wire(value):777 try:778 return base64.b64decode(urllib.parse.unquote(value)).decode("utf-8")779 except:780 return base64.b64decode(urllib.unquote(value)).decode("utf-8")781if __name__ == '__main__':782 import argparse783 parser = argparse.ArgumentParser(description='AutoItDriverServer - a webdriver-compatible server for use with desktop GUI automation via AutoIt COM/DLL interface.')784 #parser.add_argument('-v', dest='verbose', action="store_true", default=False, help='verbose mode')785 parser.add_argument('-a', '--address', type=str, default=None, help='ip address to listen on')786 parser.add_argument('-p', '--port', type=int, default=4723, help='port to listen on')787 parser.add_argument('-c', '--autoit_options_file', type=str, default=None, help='config file defining the AutoIt options to use, see default sample config file in the app/server directory')788 args = parser.parse_args()789 790 if args.address is None:...

Full Screen

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 AutoItDriverServer automation tests on LambdaTest cloud grid

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

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful