Sign in to follow this  
Followers 0
rbhkamal

Clicking Items In A List View Inside Ie.

10 posts in this topic

#1 ·  Posted (edited)

Hi

how can I click on a specific item in a list box inside IE?

Edit: I was unable to select because (<select name="encryptionSourceStrings" multiple="1" size="8" ....) had multiple="1".

when I removed it (not good) every thing worked fine.

If take a look at my html you will see that there is a list box on the left and other on the right.

My goal is to have only one specific item in the right list box using the buttons.

For example:

If there were in the right list box Idea, AES128 and None and in the left DES and TDES, I want to move all the items from the right to the left then move only TDES from the left to the right.

The problem is that I couldn’t click on a specific item in that list box.

In other words I wasn’t able to select TDES (or any thing else) from the list box, but I managed to get every thing else working.

Edit: I was hopping that _IEClickLinkByText( $IE , “TDES” ) will work but it didn’t.

Edit: Changed ListView word to list box

Thanks

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites



Sorry I forgot the html. :think:

here:


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

what's a ListView?

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

#4 ·  Posted (edited)

Hi

how can I click on a specific item in a listView inside IE?

If take a look at my html you will see that there is a listView on the left and other on the right.

My goal is to have only one specific item in the right listView using the buttons.

For example:

If there were in the right listView Idea, AES128 and None and in the left DES and TDES, I want to move all the items from the right to the left then move only TDES from the left to the right.

The problem is that I couldn’t click on a specific item in that listView.

In other words I wasn’t able to select TDES (or any thing else) from the listView, but I managed to get every thing else working.

Edit: I was hopping that _IEClickLinkByText( $IE , “TDES” ) will work but it didn’t.

Thanks

What you are working with is a list box not a listview. If you could post the source from the webpage it would be easier to come up with a solution.

Edit: I was a little slow on asking for the source.

Edited by big_daddy

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

to make it more simple:

How can I select "<option value="2">DES</option>" in <select name="encryptionSourceStrings" multiple="1"... ?

not sure if want I want is clear to you.:think:

Edit: I was unable to select because (<select name="encryptionSourceStrings" multiple="1" size="8" ....) had multiple="1".

when I removed it (not good) every thing worked fine.

here is part of the source:

<select name="encryptionListDestStrings" multiple="1" size="8" style="width: 140px;" ondblclick="MoveOption(this.form.encryptionListDestStrings, this.form.encryptionSourceStrings);storeSelections(this.form.encryptionListDestStrings, 'encryptions');">
                
                  <option value="1">Idea</option>
                
                  <option value="6">AES256</option>
                
                  <option value="8">ESP_TDES</option>
                
                  <option value="7">ESP_DES</option>
                
                  <option value="5">AES192</option>
                
                  <option value="4">AES128</option>
                
            </select>
Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

Let me make it simpler:

This is a different example:

<td class="blacktext1" bgcolor="#ffffff" valign="center"><input name="selectedDPFSessions" value="3" type="checkbox"></td>
<td class="blacktext1" bgcolor="#ffffff" valign="center"><input name="selectedDPFSessions" value="2" type="checkbox"></td>

These two lines are identical the only difference is the Value.

In case there was a form, how can you simulate a click for these check boxes?

Here is the complete source for this example:


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

Let me make it simpler:

This is a different example:

<td class="blacktext1" bgcolor="#ffffff" valign="center"><input name="selectedDPFSessions" value="3" type="checkbox"></td>
<td class="blacktext1" bgcolor="#ffffff" valign="center"><input name="selectedDPFSessions" value="2" type="checkbox"></td>

These two lines are identical the only difference is the Value.

In case there was a form, how can you simulate a click for these check boxes?

Here is the complete source for this example:

_IEFormElementGetObjByName($o_object, $s_name, $i_index = 0) -- notice the index parameter

the first checkbox is index 0 then 1 etc. so

_IEFormElementGetObjByName($oForm, "selectedDPFSessions", 0).checked = "True"
_IEFormElementGetObjByName($oForm, "selectedDPFSessions", 1).checked = "True"

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

Thanks Dale.

How can I fix this?

Here is my autoIt code:

#include <IE.au3>
Global $oIE , $L_oForm , $L_oButton

$sUrl = @ScriptDir&"\list.html"

$oIE = _IECreate()
_IENavigate($oIE, $sUrl)
_IELoadWait($oIE , 500 )

$L_oForm = _IEFormGetObjByName($oIE, "MeshConnectionForm")
$L_oButton = _IEFormElementGetObjByName($L_oForm, "encryptionSourceStrings")

ConsoleWrite('Before = ' & _IEFormElementGetValue($L_oButton) & @lf & '>Error code: ' & @error & @lf)
MsgBox( 0 , "" , "" )
_IEFormElementSetValue($L_oButton, 2)
ConsoleWrite('After = ' & _IEFormElementGetValue($L_oButton) & @lf & '>Error code: ' & @error & @lf)

And here is the html source:

<form name="MeshConnectionForm" >


            <select name="encryptionSourceStrings" multiple = "1" size="8" style="width: 140px;">
                
                  <option value="0">None</option>
                
                  <option value="1">Idea</option>

                
                  <option value="2">DES</option>
                
            </select>
        </td>

when running the script with multiple = "1" here is what happens:

The wanted value gets highlighted

The value will be still the same as it was before. @@Debug( 'IEFormElementGetValue= 0 , IEFormElementGetValue= 0)

Now, if you delete the option multiple = "1" it will start working.@@Debug( 'Before = 0 , After = 1)


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

Here is the script and the html file.

The html file has the option multiple = "1"

Let me know if you need anything else.

OS: Win XP SP2

AutoIt beta 3.1.1.118


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

The answer is here.


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

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  
Followers 0