Jump to content
Sign in to follow this  
isabelleglt

How to play with ComboBox in web pages page

Recommended Posts

isabelleglt

Hi,

I need to do specific selection in a ComboBox in a web page. I try _IELinkClickByText without success. I also try to use the ControlSend command but my combo doesn't have an ID.

Is there another way to play with my ComboBox?

The only way I found is to use the MouseMove...

Thanks,

Isabelle

Share this post


Link to post
Share on other sites
PsaltyDS

Hi,

I need to do specific selection in a ComboBox in a web page. I try _IELinkClickByText without success. I also try to use the ControlSend command but my combo doesn't have an ID.

Is there another way to play with my ComboBox?

The only way I found is to use the MouseMove...

Thanks,

Isabelle

_IEFormElementOptionselect()

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
isabelleglt

_IEFormElementOptionselect()

:)

Thank you for this answer.

I did some tests and I found that it's only working if there is just one frame in the page...

Am I right? If yes, any idea? If no, what can I do in a multiple frame page?

Thanks again,

Isabelle

Share this post


Link to post
Share on other sites
ProgAndy

$oFrame = _IEFrame..

$oForm = _IEFormGet...

$oCombo = _IEFormGetElement...

_IEFormElementOptionselect($OCombo,...


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
PsaltyDS

Thank you for this answer.

I did some tests and I found that it's only working if there is just one frame in the page...

Am I right? If yes, any idea? If no, what can I do in a multiple frame page?

Thanks again,

Isabelle

No, but you must drill down to the frame to reference the object, and once you reference the selection object, it will work (as ProgAndy shows above).

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
isabelleglt

No, but you must drill down to the frame to reference the object, and once you reference the selection object, it will work (as ProgAndy shows above).

:(

Here is the result I got: :)

@ Trace(31) : $oFrame = _IEFrameGetObjByName($oIE,"contents")

C:\Program Files\AutoIt3\Include\IE.au3 (674) : ==> The requested action with this object has failed.:

If String($o_object.document.body.tagName) = "FRAMESET" Then

If String($o_object.document^ ERROR

Share this post


Link to post
Share on other sites
PsaltyDS

Here is the result I got: :(

@ Trace(31) : $oFrame = _IEFrameGetObjByName($oIE,"contents")

C:\Program Files\AutoIt3\Include\IE.au3 (674) : ==> The requested action with this object has failed.:

If String($o_object.document.body.tagName) = "FRAMESET" Then

If String($o_object.document^ ERROR

Run the code example in the help file under _IEIsFrameSet(), after tweaking it for your site. What do you get for the number of Frames or iFrames?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
isabelleglt

Run the code example in the help file under _IEIsFrameSet(), after tweaking it for your site. What do you get for the number of Frames or iFrames?

:)

I got 3. I also tried again with a sleep and I saw the same error.

Share this post


Link to post
Share on other sites
PsaltyDS

I got 3.

Three what? What was the exact message? I was looking for whether it was Frames or iFrames; it makes a difference.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
isabelleglt

Three what? What was the exact message? I was looking for whether it was Frames or iFrames; it makes a difference.

:)

Here is the complete message:

Page contains 3 Frames in a FrameSet.

Share this post


Link to post
Share on other sites
PsaltyDS

Here is the complete message:

Page contains 3 Frames in a FrameSet.

I'm sorry to sound so suspicious, but did you leave "$oIE = _IE_Example("Frameset") in your test? Because that is exactly the message you get from the example page. I was interested in what you got from YOUR web page, not Dale's example page. Instead of loading the example, load your page and then run the rest of the script to see what the frames status is. For example:

#include <IE.au3>

$sURL = "http://news.bbc.co.uk"; <=== change this to YOUR site!

$oIE = _IECreate($sURL)
$oFrames = _IEFrameGetCollection($oIE)
$iNumFrames = @extended
If $iNumFrames > 0 Then
    If _IEIsFrameSet($oIE) Then
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " frames in a FrameSet")
    Else
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " iFrames")
    EndIf
Else
    MsgBox(0, "Frame Info", "Page contains no frames")
EndIf

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
isabelleglt

I'm sorry to sound so suspicious, but did you leave "$oIE = _IE_Example("Frameset") in your test? Because that is exactly the message you get from the example page. I was interested in what you got from YOUR web page, not Dale's example page. Instead of loading the example, load your page and then run the rest of the script to see what the frames status is. For example:

#include <IE.au3>

$sURL = "http://news.bbc.co.uk"; <=== change this to YOUR site!

$oIE = _IECreate($sURL)
$oFrames = _IEFrameGetCollection($oIE)
$iNumFrames = @extended
If $iNumFrames > 0 Then
    If _IEIsFrameSet($oIE) Then
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " frames in a FrameSet")
    Else
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " iFrames")
    EndIf
Else
    MsgBox(0, "Frame Info", "Page contains no frames")
EndIf

:)

The result I got is the one from my web site. I double check and the URL in the _IECreate is mine.

Don't be sorry, you just investigating...

Any idea? :(

Share this post


Link to post
Share on other sites
PsaltyDS

The result I got is the one from my web site. I double check and the URL in the _IECreate is mine.

Don't be sorry, you just investigating...

Any idea? :)

OK, next we list the names of the Frames visible. Run this version from SciTE so you can see the console output, after changing $sURL to your URL:
#include <IE.au3>
$sURL = "http://your.web.site.com"; <=== change this to YOUR site!
$oIE = _IECreate($sURL)
$colFrames = _IEFrameGetCollection($oIE)
$iNumFrames = @extended
If $iNumFrames > 0 Then
    If _IEIsFrameSet($oIE) Then
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " frames in a FrameSet")
        For $n = 0 to $iNumFrames - 1
            $oFrame = _IEFrameGetCollection($oIE, $n)
            ConsoleWrite("Frame: " & $n & "  Name: " & $oFrame.name & @LF)
        Next
    Else
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " iFrames")
    EndIf
Else
    MsgBox(0, "Frame Info", "Page contains no frames")
EndIf

:(


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
isabelleglt

OK, next we list the names of the Frames visible. Run this version from SciTE so you can see the console output, after changing $sURL to your URL:

#include <IE.au3>
$sURL = "http://your.web.site.com"; <=== change this to YOUR site!
$oIE = _IECreate($sURL)
$colFrames = _IEFrameGetCollection($oIE)
$iNumFrames = @extended
If $iNumFrames > 0 Then
    If _IEIsFrameSet($oIE) Then
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " frames in a FrameSet")
        For $n = 0 to $iNumFrames - 1
            $oFrame = _IEFrameGetCollection($oIE, $n)
            ConsoleWrite("Frame: " & $n & "  Name: " & $oFrame.name & @LF)
        Next
    Else
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " iFrames")
    EndIf
Else
    MsgBox(0, "Frame Info", "Page contains no frames")
EndIf

:)

Here is my result:

C:\Test\_IEIsFrameSet.au3 (27) : ==> The requested action with this object has failed.:

ConsoleWrite("Frame: " & $n & " Name: " & $oFrame.name & @LF)

ConsoleWrite("Frame: " & $n & " Name: " & $oFrame.name ^ ERROR

The site I am working with is HTTPS. Is it possible that it causes the issue?

Share this post


Link to post
Share on other sites
DaleHohm

HTTPS will not be an issue, but using PsaltyDS suggestions, add _IEErrorHandlerRegister() after your #includes. I suspect you'll see an "Access is denied." error that indicates cross-site frame scripting security restrictions. You'd need to open the target URL of the affected frame in a new browser window if this is the case.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
isabelleglt

HTTPS will not be an issue, but using PsaltyDS suggestions, add _IEErrorHandlerRegister() after your #includes. I suspect you'll see an "Access is denied." error that indicates cross-site frame scripting security restrictions. You'd need to open the target URL of the affected frame in a new browser window if this is the case.

Dale

You were right. I received an Access Denied.

I try now to open the frame in a new window.

Share this post


Link to post
Share on other sites
isabelleglt

HTTPS will not be an issue, but using PsaltyDS suggestions, add _IEErrorHandlerRegister() after your #includes. I suspect you'll see an "Access is denied." error that indicates cross-site frame scripting security restrictions. You'd need to open the target URL of the affected frame in a new browser window if this is the case.

Dale

My web site redirect automatically to the main page when we enter the frame URL.

Do you have another idea?

:)

Share this post


Link to post
Share on other sites
DaleHohm

Only resorting to SEND and ControlSEND functions. Sorry - they closed and locked the doors.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
isabelleglt

Only resorting to SEND and ControlSEND functions. Sorry - they closed and locked the doors.

Dale

Ouch...

I can't use these functions because my combo doesn<t have an ID...

I can't use IE statement because the security on the site...

So, what can I do to play with my combo? Nothing? :)

Share this post


Link to post
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
Sign in to follow this  

×