-
Posts
119 -
Joined
-
Last visited
-
Days Won
1
TheOne23 last won the day on July 1 2020
TheOne23 had the most liked content!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
TheOne23's Achievements

Adventurer (3/7)
7
Reputation
-
Hi everyone, I would like to seek your help why sometimes the code or script I am running exits after _WD_FindElement successfully receives a correct element ID. here is the code: _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, '/html/body/div[4]/div/div[3]/div/div[3]/div/frame-router/iframe',2000,Default,Default,Default,Default) $iFrame_val = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath,'/html/body/div[4]/div/div[3]/div/div[3]/div/frame-router/iframe') ;~ ConsoleWrite("outside Frame") If $iFrame_val = "" Then ConsoleWrite("Inside the Frame - failed") do sleep(1000) _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, '/html/body/div[4]/div/div[3]/div/div[3]/div/frame-router/iframe',5000,Default,Default,Default,Default) local $iFrame_val = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '/html/body/div[4]/div/div[3]/div/div[3]/div/frame-router/iframe') ;~ ConsoleWrite("Frame not yet found") until $iFrame_val <> "" Here is the logs on the console where you can see it exits. __WD_Post: URL=HTTP://127.0.0.1:9515/session/77c1fb1b03252c172093747689f3a1b2/element; $sData={"using":"xpath","value":"/html/body/div[4]/div/div[3]/div/div[3]/div/frame-router/iframe"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"f.F1B254D330E71164B196301418F2A157.d.22B7D63D185732... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"f.F1B254D330E71164B196301418F2A157.d.22B7D63D18573297274CDAACC74BAEAA.e.70"}} _WD_WaitElement ==> Success __WD_Post: URL=HTTP://127.0.0.1:9515/session/77c1fb1b03252c172093747689f3a1b2/element; $sData={"using":"xpath","value":"/html/body/div[4]/div/div[3]/div/div[3]/div/frame-router/iframe"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"f.F1B254D330E71164B196301418F2A157.d.22B7D63D185732... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"f.F1B254D330E71164B196301418F2A157.d.22B7D63D18573297274CDAACC74BAEAA.e.70"}} >Exit code: 0 Time: 94.61
-
TheOne23 reacted to a post in a topic: AutoIT Editor Dark Theme
-
Hi MLipok, My main concern or problem here was already resolved. Below is the solution. local $ohandle = _WD_Window($sSession,"handles") ;~ _ArrayDisplay($ohandle) local $win2 = _WD_Window($sSession, 'switch', '{"handle":"'& $ohandle[1] &'"}') The intention here is to connect to the handle that was created by the webpage where it is not created by the script. The new tab here is not intentionally created by the script but it was created by the javascript of the webpage I am accessing. With the use of the function _WD_Window to search a handle and switch to it, this solved the issue I am facing. Posted August 2 I already confirmed that my inquiry was resolved. I guess the other question was created by Champak.
-
Hi Champak, That is possible as long as you can manipulate the flow of the process. You can do a logic that it will sleep for some few seconds until the element is found before you will proceed with next step. But if the page that you will open shall remain open then it will cause a huge memory usage that may result to hang-up of your machine.
-
TheOne23 reacted to a post in a topic: Webdriver - how to switch to another tab session and do web scraping
-
TheOne23 reacted to a post in a topic: StringRegEx not working when inserting a variable in the pattern
-
TheOne23 reacted to a post in a topic: StringRegEx not working when inserting a variable in the pattern
-
Hi Web Driver AutoIT experts, I would like to ask your kind help if we have something similar to python's script of switching from main browser to another tab browser and apply the web scraping on that session. I tried below but seems like I am missing something. local $ohandle = _WD_Window($sSession,"handles") Python Script that I would like to have same functionality with AutoIT. browser.switch_to.window(browser.window_handles[1]) Appreciate for our inputs on this request. Thank you
-
Hi Guys, Can you help me figure out why my test script is not working? it is showing "0" which is not match where I tried to put same value of string already. It worked when it is not in a variable format. Example: This works - StringRegExp($short_description_text_1,'(po)(?!.*\1\b)',$STR_REGEXPMATCH) This does not work - StringRegExp($short_description_text_1,$string,$STR_REGEXPMATCH) #include <MsgBoxConstants.au3> #include <StringConstants.au3> local $short_description_text_1 = "po" local $keywords_split_2 = "po" local $string = "'("& $keywords_split_2 &")(?!.*\1\b)'" ;~ MsgBox(0,"",$string) ;~ MsgBox(0,"result: ",StringRegExp($short_description_text_1, "'(" & $keywords_split_2 & ")(?!.*\1\b)'" ,$STR_REGEXPMATCH)) MsgBox(0,"result: ",StringRegExp($short_description_text_1,$string,$STR_REGEXPMATCH))
-
TheOne23 reacted to a post in a topic: Need help making correct string representation of raw value in a json file into my autoit code.
-
Hi @Danp2, I am trying to convert the 2nd snippet for the 1st snippet $req variable where the request variable will contain the 2nd snippet to I can get the output coming out of the 2nd snippet. The 2nd snippet it the body of the request where I have hard time how to incorporate it in AutoIT code in my 1st snippet.
-
Hi Everyone / Json Masters, May I seek your assistance to help me with my code. My code is able to login and get bearer token but I am unable to make a working string representation of the Json raw data to my script. My script doesn't give any errors but blank response. The second snippet is the Json raw data where I am trying to convert to a string to be called as a request to be able to get a proper response / output. _GetToken() ;~ MsgBox(0,"",$sU_Token) $sBaseurl2 = $url $oHttp = Objcreate("winhttp.winhttprequest.5.1") $oHttp.open("POST", $sBaseurl2, False) $oHttp.SetRequestHeader("Content-Type","application/json") $oHttp.SetRequestHeader("Authorization", "Bearer " & $sU_Token) $oHttp.SetRequestHeader("Accept","application/json") $req = '{busObId: 6dd53665c0c24cab86870a21cf6434ae,&Fields: [6ae282c55e8e4266ae66ffc070c17fa3],&filters: [{fieldId: 9365a6098398ff2551e1c14dd398c466d5a201a9c7,&operator: equals,&value: Incident}]}]}' ;~ $oHttp.Option(4) = 0x3300 $oHttp.Send($req) $oReceived = $oHttp.ResponseText $oStatus = $oHttp.Status $sCanisterVal = $oReceived Consolewrite ($oReceived) { "busObId": "6dd53665c0c24cab86870a21cf6434ae", //Incident Business Object ID //Fields Return "Fields": [ "6ae282c55e8e4266ae66ffc070c17fa3" //Ticket ID ], "filters": [ { "fieldId": "9365a6098398ff2551e1c14dd398c466d5a201a9c7", //Incident Type "operator": "equals", "value": "Incident" }, { "fieldId": "83c36313e97b4e6b9028aff3b401b71c", //Priority "operator": "equals", "value": "1" }, //Status { "fieldId": "5eb3234ae1344c64a19819eda437f18d", //Status "operator": "equals", "value": "New" }, { "fieldId": "5eb3234ae1344c64a19819eda437f18d", //Status "operator": "equals", "value": "Assigned" }, { "fieldId": "5eb3234ae1344c64a19819eda437f18d", //Status "operator": "equals", "value": "In Progress" }, { "fieldId": "5eb3234ae1344c64a19819eda437f18d", //Status "operator": "equals", "value": "Pending" }, { "fieldId": "5eb3234ae1344c64a19819eda437f18d", //Status "operator": "equals", "value": "Reopened" } ] }
-
Basic auth on REST API the easy way ?
TheOne23 replied to billou95's topic in AutoIt General Help and Support
Hi Melba23, I see. Thank you for the updates and response. By the way, do you have anything I can use to connect to an API where I have the following information from the other developer team I am connecting with. 1.) ClientID 2.) Payload 3.) url for the token 4.) username and password 5.) API link -
Basic auth on REST API the easy way ?
TheOne23 replied to billou95's topic in AutoIt General Help and Support
Hi billou95, Do you have a sample of the full code for this basic auth on rest api?