Danp2 Posted January 19, 2023 Author Share Posted January 19, 2023 @DoVinhTrungMixing different technologies (Webdriver and WinAPI) can be problematic, so there may be a better alternative. You haven't told us what you want to accomplish with the converted hWnd, so it's difficult to know how to best guide you. Is there a reason that you can't tell us the Windows APIs that you intend to use? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DoVinhTrung Posted January 19, 2023 Share Posted January 19, 2023 37 minutes ago, Danp2 said: @DoVinhTrungMixing different technologies (Webdriver and WinAPI) can be problematic, so there may be a better alternative. You haven't told us what you want to accomplish with the converted hWnd, so it's difficult to know how to best guide you. Is there a reason that you can't tell us the Windows APIs that you intend to use? i try use snapshoot bt webdriver but in active,i want change winapi hwnd for snapshoot Link to comment Share on other sites More sharing options...
Danp2 Posted January 19, 2023 Author Share Posted January 19, 2023 @DoVinhTrungIf I understood you correctly, you are trying to capture a screenshot of a browser tab that isn't the current active tab. Is that correct? P.S. You don't need to quote my prior message each time you reply. ๐ Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DoVinhTrung Posted January 20, 2023 Share Posted January 20, 2023 (edited) @danp2 When I take a picture, Chrome is always activated Chrome is very difficult to take, is there a way to take a photo without active Chrome? Edited January 20, 2023 by DoVinhTrung Link to comment Share on other sites More sharing options...
Danp2 Posted January 20, 2023 Author Share Posted January 20, 2023 @DoVinhTrungYou could run the browser in "headless" mode, where the browser isn't shown at all. There's an FAQ in the wiki that covers that. I believe it has also been discussed elsewhere in this forum. P.S. It's best if you can paste without formatting when you use a language translator. That should avoid the white background and the oversized text. DoVinhTrung 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
iSan Posted January 30, 2023 Share Posted January 30, 2023 On 1/9/2023 at 11:09 PM, SOLVE-SMART said: Hi @iSan, yes your last code snippet looks good/should be correct. So you still only receive one element which could be caused by an loading issue of the website. It's not very likely, but please add __WD_Sleep(2000) before you try to get the table rows. Just as an tryout. Could you maybe show us more screenshots from the website?ย Simply set MsgBox()ย commands before and after, take a screenshot, that's it. Best regards Sven I have freetime now then i try this again and i found the point. My pre-code: $aTable = _WD_FindElement($sSession, 'xpath', '//table[@id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_gridTable"]//tr', Default, True) New code: $tElement = _WD_FindElement($sSession, 'xpath', '//table[@id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_gridTable"]' & '/tbody/tr', "", True) I think the difference is '/tbody' before /trย Now i solved my problem, thank you. Link to comment Share on other sites More sharing options...
iSan Posted January 30, 2023 Share Posted January 30, 2023 I'm trying to set value to an input element in a table. I tryedย _WD_SetElementValue with Option_standard but got some issue: $VAT_Element =_WD_FindElement($sSession, 'xpath', '//input[@id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_inputCell_1.22"]') _WD_SetElementValue($sSession, $VAT_Element, "10", $_WD_OPTION_Standard) Sleep(50) Consol: _WD_ElementAction ==> Element interaction issue [14] : Parameters: Command=value Option=<masked> I tryedย _WD_SetElementValue with Option_advanced, that cleared entire row, the value is setย in the exact element i need $VAT_Element =_WD_FindElement($sSession, 'xpath', '//input[@id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_inputCell_1.22"]') _WD_SetElementValue($sSession, $VAT_Element, "10", $_WD_OPTION_Advanced) Sleep(50) Element of input id: <input id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_inputCell_1.22" ondrop="return false" spellcheck="false" autocomplete="off" onchange="if($func.clientChange(this)) onChange$GridVoucherDetail$TaxCode(this);" onfocus="$find('ctl00_FastBusiness_MainReport_dirExtender_FormGridd98')._focus(this);" onblur="$find('ctl00_FastBusiness_MainReport_dirExtender_FormGridd98')._blur(this);" class="CellInput TextInput " type="text" value="" oncontextmenu="$func.showContextMenu(event, this, 'v', false);return false;" style="width: 100%;"> ย Link to comment Share on other sites More sharing options...
Danp2 Posted January 30, 2023 Author Share Posted January 30, 2023 @iSanMy crystal ball is currently being repaired, so it's going to be even more difficult to guide you. ๐ iSan 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DoVinhTrung Posted January 30, 2023 Share Posted January 30, 2023 @Danp2ย how to get text with js. i runย _WD_ExecuteScript($sSession, 'document.querySelector("._1OHuyaWUveYNPK5xXbnC2r").textContent') .This is return "value" : "null" ย Link to comment Share on other sites More sharing options...
Danp2 Posted January 30, 2023 Author Share Posted January 30, 2023 @DoVinhTrungI imagine that you would get the same result if you ran the same Javascript code from the Dev Tools console. This would indicate that something is incorrect with your JS code. On second glance, you aren't returning a value, so that would explain the null. Try prepending "return " to your JS code. Also, you should explain why you are attempting to retrieve the text this way instead of using _WD_ElementAction. SOLVE-SMART 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
iSan Posted January 31, 2023 Share Posted January 31, 2023 11 hours ago, Danp2 said: @iSanMy crystal ball is currently being repaired, so it's going to be even more difficult to guide you. ๐ Sorry i don't understand. Am i misunderstood something?ย ๐ Link to comment Share on other sites More sharing options...
Danp2 Posted January 31, 2023 Author Share Posted January 31, 2023 @iSanImagine that you are an auto mechanic. Your client calls from out of town to say that the car is making a funny noise, then expects you to diagnose the problem without being able to see, touch, or listen to the car. That's essentially what you are expecting us to do when you -- - don't post a short reproducer script, and - don't provide detailed logs, and - don't provide the target website or one that exhibits the same behavior ย Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
iSan Posted January 31, 2023 Share Posted January 31, 2023 @Danp2ย I know that i'm asking too much. -The Website requires login to active. You can see the image i posted, i useย _WD_SetElementValue with Option_advanced to a cell in Row 1st, and it clears entire row, only fill the cell i chosed.ย -I use justย _WD_SetElementValue andย _WD_FindElement in core.au3 and help.au3, there are noย short reproducer script. ย -This time when i tryย _WD_SetElementValue with Option_standard, showed in consol: _WD_FindElement ==> Success [0] : Parameters: Strategy=xpath Selector=//input[@id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_inputCell_1.22"] StartNodeID=Default Multiple=Default ShadowRoot=Default __WD_Post ==> Element interaction issue [14] : HTTP status = 400 _WD_ElementAction ==> Element interaction issue [14] : Parameters: Command=value Option=<masked> _WD_SetElementValue ==> Element interaction issue [14] : Parameters: Element=b6225db5-7212-4723-ab51-eecc2ba57df3 Value=10 Style=0 I found it in core.au3 file: $_WD_ERROR_ElementIssue, _ ; Problem interacting with element (click intercepted, etc) Can you help me which part is the problem? If my questions make you confuse, please ignore. I preciate your attention Link to comment Share on other sites More sharing options...
Danp2 Posted January 31, 2023 Author Share Posted January 31, 2023 1 hour ago, iSan said: $_WD_ERROR_ElementIssue This would be the result if the webdriver returned an error indicating either "element click intercepted" or "element not interactable". If you increase the debug level to "full", then you would see the actual output in the logs. Quote The Website requires login to active. That's fine. Is it one that we can access and create a test account? If not, then you should try to find an alternate website that demonstrates the same issues. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
iSan Posted January 31, 2023 Share Posted January 31, 2023 @Danp2Seem like the input Element is not show, so i can not click or put value into it. I think i need to move scroll-bar to show the Elementย Image: If i want to put value to Elements in column no 10, i need to move scroll-bar to show the Elements. I'm i right? Do you have any advice or suggest for me? Ex: element of first cell in column no 10: <td id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_gridCell_1.10" class="CellDefault" nowrap="" style="width: 80px; overflow: hidden; vertical-align: middle;"><div class="RowCellContainer" style="width: 80px; vertical-align: middle;"><input id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_inputCell_2.13" ondrop="return false" spellcheck="false" autocomplete="off" onchange="if($func.clientChange(this)) onChange$GridVoucherDetail$ImportTaxCode(this);" onfocus="$find('ctl00_FastBusiness_MainReport_dirExtender_FormGridd98')._focus(this);" onblur="$find('ctl00_FastBusiness_MainReport_dirExtender_FormGridd98')._blur(this);" class="CellInput TextInput " type="text" value="" oncontextmenu="$func.showContextMenu(event, this, 'v', false);return false;"></div></td> ย Link to comment Share on other sites More sharing options...
Danp2 Posted January 31, 2023 Author Share Posted January 31, 2023 @iSanSorry, but I am not able to assist further without access to the target website. iSan 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted January 31, 2023 Share Posted January 31, 2023 (edited) In addition to @Danp2ย statement: 1 hour ago, Danp2 said: @iSanSorry, but I am not able to assist further without access to the target website. me neither. You received several suggestions and hints about what we need to help you (seeย this postย orย this postย or others), but unfortunately you don't understand ๐ . It's simply not possible to help you without sharing the website or have a look atย a similar one. Either you find a way to provide such information in a clear way (record a video or whatever) or I personally don't see any chance for a valuable help. Best regards Sven Edited January 31, 2023 by SOLVE-SMART Stay innovative! Spoiler ๐ย Au3Forums ๐ฒ AutoIt (en) Cheat Sheet ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
iSan Posted January 31, 2023 Share Posted January 31, 2023 (edited) @Danp2That is the scroll-bar of a table in website, not scroll-bar of browser @SOLVE-SMARTI try to get my own example websiteย and record a video.ย I have a table with 10 column Points, i use _WD_ElementAction to put value to cells in columns Points1 to Points5 thats OK. But iย try to put value into cells in columns Points7 to Points10 (video is columns Points8), did not work. -Try withย _WD_ElementAction, found Element but got Element interaction issue, i guest Element ofย cells in columns Points7 to Points10 are hiden, need to move scroll-bar to show then useย _WD_ElementAction. _WD_FindElement ==> Success [0] : Parameters: Strategy=xpath Selector=//input[@id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_inputCell_1.22"] StartNodeID=Default Multiple=Default ShadowRoot=Default __WD_Post ==> Element interaction issue [14] : HTTP status = 400 _WD_ElementAction ==> Element interaction issue [14] : Parameters: Command=value Option=<masked> _WD_SetElementValue ==> Element interaction issue [14] : Parameters: Element=b6225db5-7212-4723-ab51-eecc2ba57df3 Value=10 Style=0 -Try with _WD_SetElementValue _WD_SetElementValue($sSession, $VAT_Element, "10", $_WD_OPTION_Standard) It clears entire Row1 like this, only 1st cell in columns Points8 have the value i set in: Is that clear? Please take a look and help me. Sory for bothering you. Tableisan.mp4 Edited January 31, 2023 by iSan Link to comment Share on other sites More sharing options...
Danp2 Posted January 31, 2023 Author Share Posted January 31, 2023 23 minutes ago, SOLVE-SMART said: record a video or whatever) ๐คฎ๐ IMO, a video doesn't help when dealing with complex issues such as this. SOLVE-SMART 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted January 31, 2023 Share Posted January 31, 2023 (edited) 1 hour ago, Danp2 said: ๐คฎ๐ IMO, a video doesn't help when dealing with complex issues such as this. That's why I wrote "or whatever" and refered to the posts with more common ways.ย Best regards Sven Edited January 31, 2023 by SOLVE-SMART Danp2 1 Stay innovative! Spoiler ๐ย Au3Forums ๐ฒ AutoIt (en) Cheat Sheet ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Recommended Posts