Sign in to follow this  
Followers 0
mjoshi

Checkbox Select

6 posts in this topic

#1 ·  Posted (edited)

Hi,

{If anyone doesn't want to go through this whole thing(understandable as it is lengthy!) then you can also give the answer of questions asked in Reply 6 i.e. #6 } :)

I have to make a function in which I have to select a user (if exists), by checking checkbox, if user doesnt exists then have to simply exit from the function.

I have uploded the 2 files.

FILE 1 --> Is the page that opens up from the previous function.

FILE 2 --> Is the page I get after sending some 'tabs' and 'enter' to the page(described in the function below)

The user which I have to select is EXECMI in the dropdown. Now, I can't simply select it because the script picks up different URL's everytime and in some sites this user doesnt exists!

I have written the below mention function, but somehow it is not working (the For loop in bold letters) and it exists without adding the user to the permission group, even if it exists.

The next function which is called after this is the exit function. and every time I am executing the script it shows me the group of users(as in file 2) and then gets exit, without adding User EXECMI

Func permissionview()

WinWaitActive("Share:ASD Channel Usage", "" , 20 )

Sleep(1000)

Send("{TAB}")

Sleep(750)

Send("{ENTER}")

Sleep(750)

Send("{DOWN}")

Sleep(750)

Send("{ENTER}")

Sleep(700)

Send("{TAB 2}")

Sleep(750)

Send("{ENTER}")

Sleep(750)

Local $oInputs = _IETagNameGetCollection($oIE, "input")

;loop through elements and get the names of the text fields for user and pass

For $oInput In $oInputs

If $oInput.type = "checkbox" And $oInput.name = "ExecMI" Then

_IEAction($oInput, "click")

Sleep(750)

send("{TAB}")

Sleep(750)

send("{ENTER}")

Sleep(750)

send("{TAB 6}")

Sleep(750)

send("{ENTER}")

Sleep(750)

EndIf

Next

EndFunc

Can anyone help.

post-69085-0-90834800-1324756420_thumb.p

post-69085-0-84223300-1324756518_thumb.p

Edited by mjoshi

Share this post


Link to post
Share on other sites



We can also try one thing- that we can send 'ExecMI'(user tio give access to) in the search box, and try to give access if some user comes in the search list, else exit the function.

But not sure how to check if some results came in the search box or not.(as shown in attachment File 2)

Any help will be highly appreciated.

Share this post


Link to post
Share on other sites

Here is what Au3Info says about this control:

_IETagNameGetCollection

Returns a collection object of all elements in the object with the specified TagName or a single element by index.

#include <IE.au3>

_IETagNameGetCollection ( ByRef $o_object, $s_TagName [, $i_index = -1] )

Parameters $o_object Object variable of an InternetExplorer.Application, Window, Frame, iFrame or any object in the DOM $s_TagName TagName of collection to return (e.g. IMG, TR etc.) $i_index [optional] specifies whether to return a collection or indexed instance

0 or positive integer returns an indexed instance

-1 = (Default) returns a collection

Return Value Success: Returns an object variable containing the specified Tag collection, @EXTENDED = specified Tag count Failure: Returns 0 and sets @ERROR @Error: 0 ($_IEStatus_Success) = No Error 3 ($_IEStatus_InvalidDataType) = Invalid Data Type 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type 5 ($_IEStatus_InvalidValue) = Invalid Value 7 ($_IEStatus_NoMatch) = No Match @Extended: Contains invalid parameter number

Remarks

The DOM is hierarchical, so if the object passed is the document object, the specified elements in the document are returned. If the object passed is an object inside the document (e.g. a TABLE object), then only the specified elements inside that object are returned.

Related

_IETagNameAllGetCollection

Example

; *******************************************************

; Example 1 - Open a browser with the form example, get the collection

; of all INPUT tags and display the formname and type of each

; *******************************************************

;

#include <IE.au3>

$oIE = _IE_Example ("form")

$oInputs = _IETagNameGetCollection ($oIE, "input")

For $oInput In $oInputs

MsgBox(0, "Form Input Type", "Form: " & $oInput.form.name & " Type: " & $oInput.type)

Next

---------------------------------------------------------------------------------

While posting this perhaps I got my mistake. Since this is not a form page and it comes when you click on search there should not be some predefined checkboxes, as these values change according to the search query.

I am wondering whether it is possible to pick the value of 'EXECMI' from the search query. Does AutoIt provide such kind of function?

Share this post


Link to post
Share on other sites

To be more clear I want to know that, if I click on 'Search'(in attached File2) whatever number of checkboxes appear in runtime I should be able to select them.

Example-- > If after clicking 'Search' 3 checkboxes apper select all the three . If only 1 checkbox appear select 1, if none appears simply exit from the function.

Is it possible?

Share this post


Link to post
Share on other sites

Okay, Lets say we are taking about GMAIL here, and we want to perform following actions.

1) Login into GMAIL

2) Search for EMAILS by GOOGLE+

3) Delete all mails by GOOGLE+ (if any), by selecting all the mails one by one(not by checking the single checkbox on the menu bar) i.e. by ticking each checkbox one by one.

I can make program till Point 2, But how to go for Point 3?

How will I know, what many Emails are going to appear in the result box, and how many I have to select.

Please help! I will be greatly thankful!

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