Jump to content

Recommended Posts

Posted
  On 1/31/2023 at 3:39 PM, iSan said:

_WD_SetElementValue($sSession, $VAT_Element, "10", $_WD_OPTION_Standard)

Expand  

You could try putting the following code before the line above --

_WD_ExecuteScript($sSession, "arguments[0].scrollIntoView(false);", '{"' & __WD_JsonElement($VAT_Element) & '"}')
Sleep(500)

This should cause the target element to be scrolled into view.

FWIW, a new function offering similar functionality will likely get added to the UDF in the future.

Posted

@Danp2 I try as you said:

$VAT_Element =_WD_FindElement($sSession, 'xpath', '//input[@id="ctl00_FastBusiness_MainReport_dirExtender_FormGridd98_inputCell_1.22"]')
Sleep(200)
_WD_ExecuteScript($sSession, "arguments[0].scrollIntoView(false);", '{"' & __WD_JsonElement($VAT_Element) & '"}')
Sleep(500)
_WD_SetElementValue($sSession, $VAT_Element, "10", $_WD_OPTION_Standard)

Here return form Consol:

__WD_Post ==> Invalid argument [5] : HTTP status = 400
_WD_ExecuteScript ==> Invalid argument [5] : Error occurred when trying to ExecuteScript
__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=5d7ae9a6-e7ab-42d1-a774-b2a87be95eca    Value=10    Style=0

 

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

@iSanThere was an error in that first line. Try this instead --

_WD_ExecuteScript($sSession, "arguments[0].scrollIntoView(false);", __WD_JsonElement($VAT_Element))

 

Expand  

@Danp2 That's all i need. Problem is solved, you should mark it. Btw i take 4 posts to present a problem 😁

Thank you and @SOLVE-SMART giving me your patient

  • 2 weeks later...
Posted
InetRead('https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-win32.zip', $INET_FORCERELOAD + $INET_IGNORESSL + $INET_BINARYTRANSFER)

on some systems results in:   Error = 32 Extended = 12157

using this 

 

I was able to check that 

  Quote
   If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SECURITY_CHANNEL_ERROR"
   If BitAND($iInfoLevel, 2) Then $sErrDesc = "The application experienced an internal error loading the SSL libraries."
Expand  

 

also in Google Chrome I see this:
image.png.0015addc8f57da4ecf3ef099ef8fe58b.png


What is going on ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 2/2/2023 at 2:19 AM, iSan said:

Thank you and @SOLVE-SMART giving me your patient

Expand  

I try my best to continue to be patient in the future @iSan 😅 .

Best regards
Sven

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

  Reveal hidden contents
Posted

Using FireFox I was able to get more info about the site certs.
Then I get 

http://cacerts.digicert.com/DigiCertTLSHybridECCSHA3842020CA1-1.crt

and add them to Windows Certifacte Storage as a trusted certificate .

Then my problem with InetGet was past.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

It seems that calls to _WD_ElementAction($sSession, $textboxID, 'value', $string) to replace the value of a text input will fail if $string contains any carriage return characters, e.g. @CR, and returns the following errors:

__WD_Post ==> Invalid argument [5] : HTTP status = 400
_WD_ElementAction ==> Invalid argument [5] : Parameters:   Command=value   Option=<masked>

Similarly, _WD_SetElementValue($sSession, $textBoxID, $string) will also fail if the $string contains a carriage return. Does anyone know of a method to get around this limitation?

Posted (edited)
  On 2/12/2023 at 7:44 AM, CodeWriter said:

will fail if $string contains any carriage return characters, e.g. @CR, and returns

Expand  

TIP: Change any new line to \n

:)

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Thanks, @mLipok for the suggestion. Some background: the text box value is being replaced with a generated report that has paragraph breaks within it. The text box doesn't interpret "\n" as a new line but just literally as the string "\n". I tried replacing @CR with Chr(13) and Chr(10) for @CRLF in the call to _WD_ElementAction() and _SetElementValue() but both still have the same error message.

Edited by CodeWriter
Posted

@CodeWriter_WD_SetElementValue support both a simple and advanced mode. Have you tried using the $_WD_OPTION_Advanced option? If that doesn't work, then I would suggest doing the following --

  • Manually enter multiple lines of text in the text box
  • Use the browser's Dev Tools to examine the element to determine how the multiple lines of text are recorded within the element.
Posted

@Danp2 Thanks. The $WD_OPTION_Advanced in _WD_SetElementValue() also fails. I've got a work around that involves double-clicking the textBox with _WD_ElementAction() to select it, followed by copy & paste. 

Posted

@Danp2The error output for _WD_ElementAction() was listed above. When I try to set the value of a textBox to "foobar" & @CR, by "fail" I mean that _WD_SetElementAction() using $_WD_OPTION_Advaced does not change the value of the textBox and the error generated is

_WD_SetElementValue ==> Invalid argument [5] : Parameters:    Element=9c970d50-d379-49bc-8387-b651e3b43935    Value=foobar     Style=1

 I haven't exhaustively tested which other characters besides @CR and @CRLF that will cause _WD_SetElementValue() and _WD_ElementAction() to fail, but there might be other special characters that won't be accepted.

Posted (edited)

@Danp2That combination worked! Thanks, again. I had tried @mLipoksuggestion of "\n" using _WD_ElementAction() but that didn't work. However, it did work with _WD_SetElementAction() using $_WD_OPTION_Advanced. The browser DEV tools didn't really help and only showed the text exactly as I had manually entered it into the text Box.

Edited by CodeWriter
Posted

Hello All,

I can't get the url or handle from the "Active" Tab.

If I open with WebDriver a new session of Firefox, and I manually open a the tab, if I execute :

$Current_Url = _WD_Action($sSession, 'url')

or

$current_tab = _WD_Window($sSession, 'Window')

It's alway the url or handle of the first tab and not the second 'active' tab.

Any idea?

Thanks

Posted (edited)

thanks,

 

So we can't know witch "user' tab" is active.
And I test, if I close the one that was originally opened, I'm getting nothing!

Current URL=__WD_Get ==> Invalid session ID [15] : HTTP status = 404

Then can I get all the opened tab url ? because I would like to continue working with similare tab'name if I found one or other (first tab by exemple) if I don't find similare tab.

thanks

Edited by tac7
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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