Jump to content

Recommended Posts

Posted
  On 1/19/2023 at 2:58 PM, 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?

Expand  

i try use snapshoot bt webdriver but in active,i want change winapi hwnd for snapshoot

Posted

@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. :thumbsup:

  • 2 weeks later...
Posted
  On 1/9/2023 at 4: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

Expand  

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.

Posted

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)

image.png.8e793c4ec4121099f3f3595280eb1e49.png

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%;">

 

Posted

@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.

Posted
  On 1/30/2023 at 2:09 PM, Danp2 said:

@iSanMy crystal ball is currently being repaired, so it's going to be even more difficult to guide you. 😏

Expand  

Sorry i don't understand. Am i misunderstood something? 😐

Posted

@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

 

Posted

@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

Posted
  On 1/31/2023 at 2:51 AM, iSan said:

$_WD_ERROR_ElementIssue

Expand  

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.

Expand  

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.

Posted

@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:

image.png.32c49635e85efc018a3f494e9911a27f.png

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?

image.png.444ae8e514ee8cdad5aa266d09250cab.png

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>

 

Posted (edited)

In addition to @Danp2 statement:

  On 1/31/2023 at 1:55 PM, Danp2 said:

@iSanSorry, but I am not able to assist further without access to the target website.

Expand  

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 by SOLVE-SMART

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

  Reveal hidden contents
Posted (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:

image.thumb.png.a711877f5adca4a2249d9a136697311c.png

Is that clear? Please take a look and help me. Sory for bothering you.

Edited by iSan
Posted (edited)
  On 1/31/2023 at 4:00 PM, Danp2 said:

🤮😆

IMO, a video doesn't help when dealing with complex issues such as this.

Expand  

That's why I wrote "or whatever" and refered to the posts with more common ways. 

Best regards
Sven

Edited by SOLVE-SMART

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

  Reveal hidden contents
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...