Dropdown menu

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
idw456
Newbie
Posts: 3
Joined: Tue Mar 13, 2018 4:06 am

Dropdown menu

Post by idw456 » Tue Mar 13, 2018 4:15 am

Hi All

I wonder if anyone can see a method of selecting from the dropdown menu on a share trading site.

An extract of the code is as follows:

Code: Select all

<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tr>
        <td>
            <div id="MiniTab_TradeStock_pnlStep1">
		
            <table cellspacing="0" cellpadding="2" width="98%" align="center" border="0">
            <tr><td class="QuoteBox" style="VERTICAL-ALIGN: middle" align="left" height="23">
                    <table cellSpacing='0' cellPadding='0' border='0' width='100%'><tr><td height='23' align='left' style='vertical-align:middle;' nowrap>&nbsp;<b><b>Select Account:&nbsp;</b></b>&nbsp;&nbsp;</td><td height='23' align='left' style='vertical-align:middle;' nowrap><select name="MiniTab$TradeStock$ctlAccountSelector$ddl" onchange="javascript:setTimeout('__doPostBack(\'MiniTab$TradeStock$ctlAccountSelector$ddl\',\'\')', 0)" id="MiniTab_TradeStock_ctlAccountSelector_ddl">
			<option selected="selected" value="1081126">Joint Holders-CASH-1081126</option>
			<option value="1259112">Super Fund-CASH-1259112</option>
I have tried quite a few combinations to no avail, eg

Code: Select all

IETagEventByAttrib>{"https://shareinvesting.anz.com/Trading/Trade/Default.aspx"},SELECT,name=MiniTab$TradeStock$ctlAccountSelector$ddl,,1081126

IETagEventByAttrib>{"https://shareinvesting.anz.com/Trading/Trade/Default.aspx"},SELECT,innertext=Joint Holders-CASH-1081126 Super Fund-CASH-1259112 ,,1081126

IEFormFill>%IE[0]%,{"MiniTab$TradeStock$ctlAccountSelector$ddl"},{""},{""},1081126,0,ie_res

Also, is there a way to use Web Recorder inside a password protected site as the web recorder does not LogOn

Thanks

Ian Watts

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Dropdown menu

Post by Marcus Tettmar » Wed Mar 14, 2018 12:49 pm

You should be able to use IEFormFill.

WebRecorder can work through password protected sites, just browse through and enter the password as you use it.

Alternatively write the code against your IE window which is already at the page. Use IEGetFromURL to get a handle to the page which you can then pass to IEFormFill.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

idw456
Newbie
Posts: 3
Joined: Tue Mar 13, 2018 4:06 am

Re: Dropdown menu

Post by idw456 » Fri Mar 16, 2018 1:02 am

Thanks for your reply.

I have tried umpteen combinations and can't get a change in the Dropdown menu.

Based on the website code I posted, which values would you suggest and where should they be placed within the IEFormFill statement?

I have another problem with LClick, but I'll start a new thread for that.

Thanks

Ian Watts

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Dropdown menu

Post by Marcus Tettmar » Fri Mar 16, 2018 8:16 am

Either do:

IEGetFromURL>unique_part_or_parent_url,IE_RES

//try via textual value that the user sees:
IEFormFill>IE_RES,FRAME_NAME,FORM NAME OR BLANK,NAME_OR_ID_OF_SELECT,TEXT VALUE,result

//try via index of item n:
IEFormFill>IE_RES,FRAME_NAME,FORM NAME OR BLANK,NAME_OR_ID_OF_SELECT,#INDEX#:n,result

//try via value
IEFormFill>IE_RES,FRAME_NAME,FORM NAME OR BLANK,NAME_OR_ID_OF_SELECT,VALUE,result

Instead of using the parent URL and frame identifier, try getting a reference of the frame itself via the frame's source URL or some unique part of it:

IEGetFromURL>unique_par_of_frame_source_url,IE_RES

Then omit the frame identifier in IEFormFill:

IEFormFill>IE_RES,,FORM NAME,FIELD NAME ....

You could also try using UIFocus. Identify the element with the Find Object Wizard.

SetFocus>window_title
UIFocus>element
Send>item_text

If that fails, find it and click on it with Image Recognition.

The IETagEventByAttrib function may also work but this doesn't take a frame, it just tries iteratively.

If I were in front of your PC I'd probably find you a solution. But you won't allow me to play :-(
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts