Jump to content

Handling Chrome controls - (Moved)


Recommended Posts

Good, How are you?

 

I'm trying to use UIAutomation but to no avail. I would like to access the page, enter login and password and click the Enter button. I have tried in many ways. I can do it quietly in IE UDF, but I would like to do it in Chorme. Can you help me?

 

Follow the page address below.

Access the URL: "https://login.vivo.com.br/loginmarca/appmanager/marca/publico?acesso=empresas&_ga=1.215903191.1168325316.1480354519&documento=29694432871&app=legacy#")

Enter Manager Login

Enter Password

Click on Enter / Submit

 

Help please!

Tks

Link to comment
Share on other sites

Hello, Danp2.

Thank you for orienting me.

 

The reason I want to use Chorme instead of IE is because _IEACTION (CLICK) fails. One hour it works another not. If by chance this action did not fail, my project would be complete.

This is what I have today and I would like to know what I am doing wrong .. because sometimes it works and another does not

 

Click here...

image.png.215235ed05f5c1635a09686a40949c8a.png


After I click on those three dots, a menu appears.

image.png.3ff518a45ea38dfd082134fcd1f94599.png

This..

_IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
     While Not 1
        _IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
        Sleep(500)
    WEnd
    Local $sMyString = "Baixar"
    Local $oLinks = _IELinkGetCollection($oIE)
    For $oLink In $oLinks
        Local $sLinkText = _IEPropertyGet($oLink, "innerText")
        If StringInStr($sLinkText, $sMyString) Then
            $sBaixa = "Sim"
            Local $oElements = _IETagNameGetCollection($oIE, "a")
            For $oElement In $oElements
                If $oElement.id=="downloadBoleto0" Or $oElement.id=="downloadFatura0" Then
                    _IEAction ($oElement, "click")
                    While Not 1
                        Sleep(500)
                        _IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
                        Sleep(500)
                        _IEAction($oLink, "click")
                        Sleep(500)
                    WEnd
                EndIf
            Next

Link to comment
Share on other sites

  • Developers

Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states:

Quote

Share your cool AutoIt scripts, UDFs and applications with others.


Do not post general support questions here, instead use the AutoIt Help and Support forums.

Moderation Team

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.
  :)

Link to comment
Share on other sites

7 hours ago, Danp2 said:

Sugira que você publique seu código mostrando que tentou até agora. Além disso, veja minha assinatura para um método alternativo de automatizar sites.

Dan


How can I handle the click actions, downloads of a Chrome page according to the previous message?

Link to comment
Share on other sites

Please post your complete script.
But please put it in a code box. See the "<>" above the edit box.

In your fragment of the script, I found a definitly wrong statement:

While Not 1

The 2  statements below  will never be executed

 

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Hello Exit,


Make up for my delay, below, follow what I used today.
When I ask him to click on the image:
_IEImgClick (...)
It opens a menu and then it searches in this drop down menu (as pictured above) the item Download the Invoice or Download Ticket.
In case I use the _IEAction ("click"). That's where the situation is:
One hour works and not another time.  That's why I thought of While,
While not true, it insists on _IEAction ("click").

_IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
    While Not 1
        _IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
        Sleep(500)
    WEnd
    Local $sMyString = "Baixar"
    Local $oLinks = _IELinkGetCollection($oIE)
    For $oLink In $oLinks
        Local $sLinkText = _IEPropertyGet($oLink, "innerText")
        If StringInStr($sLinkText, $sMyString) Then
            $sBaixa = "Sim"
            Local $oElements = _IETagNameGetCollection($oIE, "a")
            For $oElement In $oElements
                If $oElement.id=="downloadBoleto0" Or $oElement.id=="downloadFatura0" Then
                    _IEAction ($oElement, "click")
                    While Not 1
                        Sleep(500)
                        _IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
                        Sleep(500)
                        _IEAction($oLink, "click")
                        Sleep(500)
                    WEnd
                EndIf
            Next
        EndIf
    Next

And one thing he always wanted to know:
In Chrome it opens directly in the Save As Dialog Box, but in Internet Explorer, it first opens a bar at the bottom of the page and I have to click on the Save filter to choose save as and then open the dialog box.
Is there any way to open direct, or better yet, save direct on the desired path?


Thank you in advance, to help me because I loved this tool and I want to enjoy the best of it. Thank you very much.

 

Link to comment
Share on other sites

You probably have not read my post?

14 hours ago, Exit said:

In your fragment of the script, I found a definitly wrong statement:

While Not 1

The 2  statements below  will never be executed

And this statement is twice in the script.

And I asked you to post the full script. Or at least an executable example.

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites


Hello,

According to the tests performed 2 different scenarios:
1) _IEAction ("click") does not perform the action.

image.png.da41bcdaa5c9091293b927741ae83865.png


2) When it executes, the box at the bottom of the window (of the Open / Save), appears but is frozen, the action to Save As is not executed.

image.png.4f4d2091ae994dc877326db24b1dc19f.png

 

What am I doing wrong? Below is the moment when the script is fired and the HTML so that it can point to something that I forgot or did the wrong procedure, orient me and explain and so I do not go wrong again. I've been in this fight for a long time and without success. Thank you in advance for your help.

;Click to Download
    $sBaixa = ""
    _IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
    Sleep(1000)
    While @error
        _IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
        Sleep(500)
    WEnd
    Local $sMyString = "Baixar"
    Local $oLinks = _IELinkGetCollection($oIE)
    For $oLink In $oLinks
        Local $sLinkText = _IEPropertyGet($oLink, "innerText")
        If StringInStr($sLinkText, $sMyString) Then
            $sBaixa = "Sim"
            Local $oElements = _IETagNameGetCollection($oIE, "a")
            For $oElement In $oElements
                If $oElement.id=="downloadBoleto0" Or $oElement.id=="downloadFatura0" Then
                    Sleep(1000)
                    _IEAction ($oElement, "click")
                    Sleep(500)
                    While @error
                        Sleep(500)
                        _IEAction($oLink, "click")
                        Sleep(500)
                    WEnd
                    ExitLoop 2
                EndIf
            Next
        EndIf
    Next

    If $sBaixa = "Sim" Then
        Local $hWnd = WinWait("[IEFrame]", "", 10)
        Do
            Sleep(1000)
        Until ControlCommand($hWnd, "", "DirectUIHWND1", "IsVisible", "")
        Sleep(500)
        ;Clicar no Filtro em Salvar
        ControlClick($sText, "", "[CLASS:DirectUIHWND; INSTANCE:1]", "left", 1, 838, 29)
        ;Send("{TAB 2}")
        Sleep(1000)
        Send("{Up}")
        Sleep(500)
        Send("a")

 

 

Link to comment
Share on other sites

_IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
Sleep(1000)
While @error ; will never entered due to no error in sleep statement
    _IEImgClick($oIE, "/meuvivoempresas/ShowPropertyServlet?nodeId=/UCMRepository/MVE_ICON_TRESPONTOS", "src")
    Sleep(500)
WEnd

While @error ; will never entered due to no error in sleep statement

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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