Posts: 166
Threads: 57
Joined: Aug 2013
Greetings,
I am having trouble getting a web page pop-up to close.
It looks like a child accessible object and works on 'test' mode.
However does not work when the program runs in total.
I have included part of the program here and the codes between 'Does not work is were the trouble seems to be.
Macro
RO Sales gDN
, int w6= wait ( 30 WC win ( "view_policy_details - Windows Internet Explorer" "IEFrame" ))
,
, ;Click 'OK'
, Htm e19= htm ( "INPUT" "btnNext" "" w6 "0" 2 0x121 3 )
, e19.Click
,
,
, ;;Does not Work
, int w5= wait ( 30 WV win ( "Client Details - Windows Internet Explorer" "IEFrame" ))
, Acc a.Find ( w5 "PUSHBUTTON" "Cancel" "class=DirectUIHWND" 0x1005 30 )
, a.Mouse ( 1 )
,
, clo w5
, ;;Does Not Work
,
, ;;clo win("Client Details - Windows Internet Explorer" "IEFrame")
,
, ;activate excel, change executed record VIN to red colour and save file
, act w1
, ' L( # 10 ); 0.12 ;; Left(*10)
, lef 331 105 w1 1 ;;property page 'Ribbon', split button 'Font Color'
, es.Save
,
Best Regards,
Philip
Posts: 12,055
Threads: 140
Joined: Dec 2002
Try to replace e19.Click to e19.ClickAsync.
Posts: 166
Threads: 57
Joined: Aug 2013
Tried, didn't work.
Below is the screen print.
Loot at the bottom of screen shot...
Attached Files
Image(s)
Best Regards,
Philip
Posts: 12,055
Threads: 140
Joined: Dec 2002
To find what wrong happens, try to run the macro in debug mode. Insert deb before click. Then run macro. When stops at the deb line, press F5 F5...
,Htm e19=htm("INPUT" "btnNext" "" w6 "0" 2 0x121 3)
,deb
,e19.ClickAsync
Also can try to replace e19.Click to e19.Mouse(1)
Posts: 166
Threads: 57
Joined: Aug 2013
I will try the debu mode now..
In the meanwhile it is Acc a object that is the issue not e19
Best Regards,
Philip
Posts: 166
Threads: 57
Joined: Aug 2013
Tried, no clue...
I couldn't decipher what was goign on...
Here is the entire code.
Maybe that could help...
Macro
RO Sales gDN
;---- Recorded 13-Oct-13 6:49:06 PM ----
opt slowkeys 1 ; opt slowmouse 1 ; spe 10
rep 14
, ;str varDate = ""
,
, ;inp- varDate "" "gDN Date"
,
,
, int w1= act ( win ( "Microsoft Excel - Test " "XLMAIN" ))
, ' D ;; Down
,
, opt slowkeys 0
, ;get selected cells in Excel
, ExcelSheet es.Init
, ARRAY ( str ) vin
, es.CellsToArray ( vin "sel" )
, ' T
, ARRAY ( str ) custType
, es.CellsToArray ( custType "sel" )
, str custType2 = custType
, ' T
, ARRAY ( str ) title
, es.CellsToArray ( title "sel" )
, str title2= title
, ' T
, ARRAY ( str ) fmName
, es.CellsToArray ( fmName "sel" )
, ' T
, ARRAY ( str ) surname
, es.CellsToArray ( surname "sel" )
, ' T
, ARRAY ( str ) fullName
, es.CellsToArray ( fullName "sel" )
, str fullName2= fullName
, ' T
, ARRAY ( str ) mobile
, es.CellsToArray ( mobile "sel" )
, ' T
, ARRAY ( str ) regNum
, es.CellsToArray ( regNum "sel" )
, ' T
, ARRAY ( str ) poBox
, es.CellsToArray ( poBox "sel" )
, ' T
, ARRAY ( str ) place
, es.CellsToArray ( place "sel" )
, ' T
, ARRAY ( str ) price
, es.CellsToArray ( price "sel" )
,
, opt slowkeys 1
,
, int w2= act ( win ( "Register Vehicle Sale - Windows Internet Explorer" "IEFrame" ))
, Htm e= htm ( "INPUT" "ctl00_cphMain_txtSelectVIN" "" w2 "0" 6 0x121 3 )
, e.SetText ( vin)
, Htm e1= htm ( "INPUT" "ctl00_cphMain_btnVINSearch" "" w2 "0" 7 0x121 3 )
, e1.Click
, wait 3
, int w= wait ( 100 WC win ( "Register Vehicle Sale - Windows Internet Explorer" "IEFrame" ))
, wait 2
, ;Vehicle Sale Date
, Htm e2= htm ( "INPUT" "ctl00_cphMain_txtSaleDate" "" w "0" 28 0x121 3 )
, ;************************************************************************CHANGE DATES HERE********************************************************************
, ;e2.SetText(varDate)
, e2.SetText ( "17/06/2014" )
,
, ;Vehicle Registration Date
, Htm e16= htm ( "INPUT" "ctl00_cphMain_txtRegDate" "" w "0" 29 0x121 3 )
, e16.SetText ( "17/06/2014" )
, ;************************************************************************CHANGE DATES HERE********************************************************************
,
,
,
, ;Client Type
, Htm e3= htm ( "SELECT" "ctl00_cphMain_cboClientType" "" w "0" 1 0x121 3 )
, ;e3.SetText(custType)
, ;e3.SetFocus
,
, int typeNum= SelStr ( 1 custType2 "C" "P" "V" )
,
, if typeNum= 1
,, e3.CbSelect ( "Company" )
,, wait 6
,, gDNCompany ( fullName2)
,, goto Mobile
, if typeNum= 2
,, e3.CbSelect ( "Private" )
,, wait 6
, if typeNum= 3
,, e3.CbSelect ( "VIP" )
,, wait 6
,,
,,
,
, ;Title
,
,,
, Htm e5= htm ( "SELECT" "ctl00_cphMain_cboTitle" "" w "0" 2 0x121 3 )
, e5.CbSelect ( title2)
, wait 2
, if title2.ucase = "OTHER"
,, Htm e21= htm ( "INPUT" "ctl00_cphMain_txtOtherTitle" "" w "0" 34 0x121 3 )
,, e21.SetText ( "-" )
,
, ;First & Middle Name
, Htm e4= htm ( "INPUT" "ctl00_cphMain_txtFirstName" "" w "0" 36 0x121 3 )
, if title2.ucase = "OTHER"
,, e4.SetText ( fullName2)
, else
,, e4.SetText ( fmName)
,
, ;Surname
, Htm e6= htm ( "INPUT" "ctl00_cphMain_txtSurname" "" w "0" 38 0x121 3 )
, if title2.ucase = "OTHER"
,, e6.SetText ( "-" )
, else
,, e6.SetText ( surname)
,
,,
,,
,,
, ;Mobile
, if fullName2= "M/s. Al Tayer Motors"
,, Htm e20= htm ( "INPUT" "ctl00_cphMain_txtTelephoneWork" "" w "0" 44 0x121 3 )
,, e20.SetText ( mobile)
,, Htm e52= htm ( "INPUT" "ctl00_cphMain_txtTelephoneMobile" "" w "0" 47 0x121 3 )
,, e52.SetText ( "-" )
, else
,, Htm e7= htm ( "INPUT" "ctl00_cphMain_txtTelephoneMobile" "" w "0" 47 0x121 3 )
,, e7.SetText ( mobile)
,
,
,
, ;Registration Number
, Htm e8= htm ( "INPUT" "ctl00_cphMain_txtRegNumber" "" w "0" 30 0x121 3 )
, e8.SetText ( regNum)
,
, ;Physical Address
, Htm e9= htm ( "INPUT" "ctl00_cphMain_txtAddress1" "" w "0" 33 0x121 3 )
, e9.SetText ( "-" )
,
, ;PO Box
, Htm e10= htm ( "INPUT" "ctl00_cphMain_txtPOBox" "" w "0" 35 0x121 3 )
, e10.SetText ( poBox)
,
, ;Post/Zip Code
, Htm e11= htm ( "INPUT" "ctl00_cphMain_txtPostcode" "" w "0" 37 0x121 3 )
, e11.SetText ( "-" )
,
, ;City
, Htm e12= htm ( "INPUT" "ctl00_cphMain_txtCity" "" w "0" 39 0x121 3 )
, e12.SetText ( place)
,
, MES m
, m.style= "OC"
, m.x= 100
, m.y= 500
, m.timeout= 800
, m.default= 'C'
, int t= mes ( "Go Ahead?" "Go Ahead?" m)
,
, ;Click Register Sale
, Htm e13= htm ( "INPUT" "ctl00_cphMain_btnRegister" "" w "0" 50 0x121 3 )
, e13.Click
,
, wait 2
, ;Click 'OK' on email error message
, ;int w3=wait(31 win("Message from webpage" "#32770"))
, ;Acc a.Find(w3 "PUSHBUTTON" "OK" "class=Button[]id=1" 0x1005)
, ;a.Mouse(1)
, ;err
,
, ;int w3=wait(31 win("Message from webpage" "#32770"))
, ;but id(1 w3) ;;push button 'OK'
, ;err
,
, wait 1
, int w4= wait ( 100 WC win ( "Client Details - Windows Internet Explorer" "IEFrame" ))
, ;Purchase Price
, Htm e14= htm ( "INPUT" "_ctl0_cphMain_txtPurchasePrice" "" w4 "0" 45 0x121 3 )
, e14.SetText ( price)
,
, ;mes- "Go Ahead?" "Go Ahead?" "OC"
,
, ;;Click Next
, Htm e15= htm ( "INPUT" "_ctl0_cphMain_btnNext" "" w4 "0" 55 0x121 3 )
, e15.Click
,
, wait 3
, int found= 0
, int w3= win ( "Internet Explorer" "IEFrame" )
, str s.getwintext ( w3)
, out s
, deb
, Htm e18= 0
, rep 60
,, Htm e50= htm ( "INPUT" "rbnTrue1" "" w3 "0" 3 0x101 )
,, if e50 ;;page "Question Time! -*"
,,, found= 1
,,, e50.Click
,,, wait 1
,,, Htm e22= htm ( "INPUT" "btnSubmit" "" w3 "0" 5 0x121 3 )
,,, e22.Click
,,, wait 2
,,, e18= htm ( "INPUT" "btnNext" "" w3 "0" 15 0x101 )
,,, wait 1
,,, e18.Click
,,, break
,, else
,,, wait 1
,,, e18= htm ( "INPUT" "btnNext" "" w3 "0" 15 0x101 )
,,, wait 1
,,, if e18 ;;page "select_product -*"
,,,, found= 2
,,,, e18.Click
,,, else
,,,, wait 2
,,,, continue
,, if ( ! found) mes "error"
,
, ;wait 30 WT w4 "view_policy_details - Windows Internet Explorer"
, int w6= wait ( 30 WC win ( "view_policy_details - Windows Internet Explorer" "IEFrame" ))
,
, ;Click 'OK'
, Htm e19= htm ( "INPUT" "btnNext" "" w6 "0" 2 0x121 3 )
, e19.Click
,
,
, ;;Does not Work
, int w5= wait ( 30 WV win ( "Client Details - Windows Internet Explorer" "IEFrame" ))
, Acc a.Find ( w5 "PUSHBUTTON" "Cancel" "class=DirectUIHWND" 0x1005 30 )
, a.Mouse ( 1 )
,
, clo w5
, ;;Does Not Work
,
, ;;clo win("Client Details - Windows Internet Explorer" "IEFrame")
,
, ;activate excel, change executed record VIN to red colour and save file
, act w1
, ' L( # 10 ); 0.12 ;; Left(*10)
, lef 331 105 w1 1 ;;property page 'Ribbon', split button 'Font Color'
, es.Save
,
, vin.redim
, custType.redim
, title.redim
, fmName.redim
, surname.redim
, fullName.redim
, mobile.redim
, regNum.redim
, poBox.redim
, place.redim
, price.redim
opt slowkeys 0 ; opt slowmouse 0 ; spe - 1
;---------------------------------------
Best Regards,
Philip
Posts: 12,055
Threads: 140
Joined: Dec 2002
What exactly does not work? Does the a.Mouse line click in a wrong place?