Jump to content

Recommended Posts

Posted (edited)

I prospose to change $iTimeout to $iTimeOut_ms

Becuase in this case in UserCallTip you will be always see, and know how to correctly determine the time.

Previously, I thought about changing/suplementing all desired function headers something like:

  Quote

;                  $iTimeout            - [optional] Period of time (in milliseconds) to wait before exiting function

Expand  

but thought that this way (proposed above) it would be more efficient, both when it comes to writing code, using CallTip, and analyzing the UDF's code in the event of a need to change it.

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)

Ok will follow this rule, and I create desired PR.

EDIT:
https://github.com/Danp2/WebDriver/pull/79

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)
  On 6/23/2021 at 6:34 PM, Danp2 said:

@gtatsI reviewed the source file you uploaded. Unfortunately, AFAICS it doesn't contain anything that would explain the behavior you're experiencing.

What process / tools are you using to find the correct xpath?

Expand  

I'm right clicking on the drop down element and selecting inspect. From the elements tab i'm checking XPath and outerHTML. 

Probably it's something jQuery related as you suggested. Anyway, it seems to be working with the use of _WD_HighlightElement and the desired option is being saved. Thanks again.

Edited by gtats
Posted

@samibb

1) This is the UDF development thread. Please post your question to the correct thread in GH&S (see my sig)

2) I gave you the best answer available based upon the very limited information you supplied (Chrome usage).

3) You should provide more details regarding your situation if you want better responses.

P.S. You could try adding the following line at the beginning of your script (before calling _WD_Startup) --

_WD_Option('DriverClose', False)

 

  • 3 weeks later...
Posted (edited)

I have a problem I think not related to WD but to this specific site but maybe somebody could help.
Take a look here:
https://ezamowienia.gov.pl/mo-client-board/bzp/list

Click on the first showed information in the table by clicking on "Szczegóły"

image.thumb.png.671ddf829793102d7f7fee754944d334.png

 

Now please try to print the page.
I'm trying to automate this page (using WD UDF) and my point is to print specific content.

Question: Why is not all the page content printed?

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

Hey,

I got a few links listed in excel that I open together in new tabs after creating the session, but I have a problem that doesn't seem big but I want to disable the "wait to load" for each page and just open them all and let them load, is that possible?

Nothing I could find to edit _WD_LoadWait() when using _WD_NewTab(), and in the timeout parameter in _WD_NewTab() I tried settings it to 0 or 1 but the script still waits for tabs that are getting opened to load one by one.

Thanks.

  • Developers
Posted
  On 7/16/2021 at 5:01 PM, Moonscarlet said:

Hey

Expand  

Did you put in the effort to read the first post in this thread? Guess not or else you would have known not to post questions here. 

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

@Danp2 thanks a lot I will look into it, I looked at this thread a while ago but forgot about using another thread for questions, really appreciate your help and efforts.

You have a great attitude that not many people do:), keep up the amazing work!

Posted

Why in _WD_Startup() there is:
 

$sFunction = "_WD_IsLatestRelease"
        $bLatest = Call($sFunction)

Instead:
 

$bLatest = Call(_WD_IsLatestRelease)

?

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)

Hi,

I suppose it's only a minimal thing I am missing, but I just can't get it done.

Goal of the script: open this webpage and close the stupid cookie-banner.

Main problem is, that (at least according to SelectorsHub) the cookie banner is a cross origin iframe. So I tried to activate this iframe to dive into it and select the button.

For your amusement, here are my futile attempts:

#include "wd_core.au3"
#include "wd_helper.au3"

Global $sSession
Global $_WD_DEBUG = $_WD_DEBUG_None

Func searcher()
    $sElement = _WD_GetElementById($sSession, "save-all-conditionally")
    If @error Then
        ConsoleWrite("!Not found with _WD_GetElementById" & @CRLF)

        $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@id='save-all-conditionally']")
        If @error Then
            ConsoleWrite("!Not found with XPath + ID" & @CRLF)

            $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[contains(text(),'Zustimmen und weiter')]")
            If @error Then
                ConsoleWrite("!Not found with XPath + Text" & @CRLF)
            Else
                ConsoleWrite("+Found with XPath + Text" & @CRLF)
            EndIf
        Else
            ConsoleWrite("+Found with XPath + ID" & @CRLF)
        EndIf
    Else
        ConsoleWrite("+Found with _WD_GetElementById" & @CRLF)
    EndIf
    _WD_FrameLeave($sSession)
EndFunc

_WD_Option('Driver', 'msedgedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--verbose')
_WD_Startup()
$sSession = _WD_CreateSession('{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}}}}')

_WD_Navigate($sSession, "https://www.gmx.net/pro_ssl/?origin=lpc")
_WD_LoadWait($sSession)
Sleep(500)

; first try with native XPath
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='overlay']")
if @error Then ConsoleWrite("!Peng" & @CRLF)
_WD_FrameEnter($sSession, $sElement)
searcher()

;
; after that, try all iframes
$x = _WD_GetFrameCount($sSession)
For $i = 0 To $x - 1
    ConsoleWrite("Frame: " & $i & @CRLF)
    _WD_FrameEnter($sSession, $i)
    if @error Then ConsoleWrite("!Peng" & @CRLF)
    searcher()
Next

_WD_DeleteSession($sSession)
_WD_Shutdown()

*sigh*

best regards,
Marc

Edited by Marc
double "that" :)

Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)

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

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