Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check Box (Website)
#3
Thanks Gintaras.

However, I am referring to the checkbox element directly.
Could you please check on the below code if I am doint it right...

Macro VISTA Order Amends
Code:
Copy      Help
;---- Recorded 29-Oct-13 6:06:04 PM ----
opt slowkeys 1; opt slowmouse 1; spe 100

int w1=act(win("Microsoft Excel - VISTA Amend" "XLMAIN"))

;Copy data from excel
'D ; 0.53    ;; Down Ctrl+C
;get selected cells in Excel
ExcelSheet es.Init
ARRAY(str) factoryOrderNum
es.CellsToArray(factoryOrderNum "sel")
'TT; 0.12
ARRAY(str) extColourTemp
es.CellsToArray(extColourTemp "sel")
str extColour = extColourTemp
'T; 0.12
ARRAY(str) trimColourTmp
es.CellsToArray(trimColourTmp "sel")
str trimColour=trimColourTmp
'T; 0.12
ARRAY(str) veneerTmp
es.CellsToArray(veneerTmp "sel")
str veneer=veneerTmp
'TT; 0.12
ARRAY(str) wheelTmp
es.CellsToArray(wheelTmp "sel")
str wheel=wheelTmp
'T; 0.12
ARRAY(str) roofTmp
es.CellsToArray(roofTmp "sel")
str roof=roofTmp
'T; 0.12
ARRAY(str) sideVentsTmp
es.CellsToArray(sideVentsTmp "sel")
str sideVents=sideVentsTmp
'T; 0.12
ARRAY(str) towBarTmp
es.CellsToArray(towBarTmp "sel")
str towBar=towBarTmp
'T; 0.12
ARRAY(str) rearEntTmp
es.CellsToArray(rearEntTmp "sel")
str rearEnt=rearEntTmp
'T; 0.12
ARRAY(str) seatTmp
es.CellsToArray(seatTmp "sel")
str seat=seatTmp
'T; 0.12
ARRAY(str) rearCoolerTmp
es.CellsToArray(rearCoolerTmp "sel")
str rearCooler=rearCoolerTmp
'T; 0.12
ARRAY(str) cruiseControlTmp
es.CellsToArray(cruiseControlTmp "sel")
str cruiseControl=cruiseControlTmp
'T; 0.12
ARRAY(str) steeringTmp
es.CellsToArray(steeringTmp "sel")
str steering=steeringTmp
'T; 0.12
ARRAY(str) soundSystemTmp
es.CellsToArray(soundSystemTmp "sel")
str soundSystem=soundSystemTmp
'TT; 0.12
ARRAY(str) cameraTmp
es.CellsToArray(cameraTmp "sel")
str camera=cameraTmp
'T; 0.12
ARRAY(str) darkAtlasTmp
es.CellsToArray(darkAtlasTmp "sel")
str darkAtlas=darkAtlasTmp
'T; 0.12
ARRAY(str) touchScreenTmp
es.CellsToArray(touchScreenTmp "sel")
str touchScreen=touchScreenTmp
'T; 0.12
ARRAY(str) parkAssistTmp
es.CellsToArray(parkAssistTmp "sel")
str parkAssist=parkAssistTmp


;Insert factory order number in website field
int w=wait(3 WV win("Find Orders - Windows Internet Explorer" "IEFrame"))
Htm e=htm("INPUT" "fromValue" "" w "0" 28 0x121 3)
e.SetText(factoryOrderNum)
;Click Search Button
Htm e1=htm("NOBR" "Search" "" w "0" 20 0x21 3)
e1.Click
;Click Maintain Orders button
int w2=wait(10 WV win("View Order - Windows Internet Explorer" "IEFrame"))
Htm e2=htm("NOBR" "Maintain Order " "" w2 "0" 7 0x21 3)
e2.Click
;Click Configurator button
int w3=wait(3 WV win("Maintain Order - Windows Internet Explorer" "IEFrame"))
Htm e3=htm("NOBR" "Configurator " "" w3 "0" 2 0x21 3)
e3.Click

;;;;;checking variable content and changing website values accordingly

int w4=wait(3 WV win("Vehicle Configuration - Windows Internet Explorer" "IEFrame"))
;changing exterior colour
Htm e4=htm("SELECT" "sel3" "" w4 "0" 8 0x121 3)

if extColour = "Santorini Black"
,e4.CbSelect("820 Santorini Black")
else if extColour = "Nara Bronze"
,e4.CbSelect("825 Nara Bronze")
else if extColour = "Aleutian Silver"
,e4.CbSelect("835 Aleutian Silver")
else if extColour = "Mariana Black"
,e4.CbSelect("860 Mariana Black")
else if extColour = "Barolo Black"
,e4.CbSelect("861 Barolo Black")
else if extColour = "Indus Silver"
,e4.CbSelect("863 Indus Silver")
else if extColour = "Havana"
,e4.CbSelect("865 Havana")
else if extColour = "Aintree Green"
,e4.CbSelect("866 Aintree Green")
else if extColour = "Fuji White"
,e4.CbSelect("867 Fuji White")
else if extColour = "Firenze Red"
,e4.CbSelect("868 Firenze Red")
else if extColour = "Luxor"
,e4.CbSelect("869 Luxor")
else if extColour = "Barossa"
,e4.CbSelect("871 Barossa")
else if extColour = "Corris Grey"
,e4.CbSelect("873 Corris Grey")
else if extColour = "Loire Blue"
,e4.CbSelect("942 Loire Blue")
else if extColour = "Scotia Grey"
,e4.CbSelect("943 Scotia Grey")
else if extColour = "Causeway Grey"
,e4.CbSelect("950 Causeway Grey")

;changing trim
Htm e5=htm("SELECT" "sel4" "" w4 "0" 9 0x121 3)

if trimColour = "Ebony Seats Ebony/Ebony Cirrus"
,e5.CbSelect("TKA Ebony Seats Ebony/Ebony Cirrus")
else if trimColour = "Ebony Seats Ebony/Ebony Ebony"
,e5.CbSelect("TKB Ebony Seats Ebony/Ebony Ebony")
else if trimColour = "Almond Seats Espresso/Almond Ivory"
,e5.CbSelect("TKC Almond Seats Espresso/Almond Ivory")
else if trimColour = "Cirrus Seats Ebony/Cirrus Cirrus"
,e5.CbSelect("TKE Cirrus Seats Ebony/Cirrus Cirrus")
else if trimColour = "Cirrus Seats Ebony/Cirrus Ebony"
,e5.CbSelect("TKF Cirrus Seats Ebony/Cirrus Ebony")

;changing veneer
Htm e6=htm("IMG" "images/,DanaInfo=www.jlrvista.franchise.jlrint.com+checkbox_red.gif" "" w4 "0" 68 0x921 3)

if veneer="Ebony Macassar"
,if e6.Checked
,,e6.Click
else if veneer="Grand Black Wood"
,if !e6.Checked
,,e6.Click


;changing alloy wheels

Htm e7=htm("IMG" "images/,DanaInfo=www.jlrvista.franchise.jlrint.com+config-selected.gif" "" w4 "0" 24 0x921 3) ;;20" Style 2
Htm e8=htm("IMG" "images/,DanaInfo=www.jlrvista.franchise.jlrint.com+checkbox_red.gif" "" w4 "0" 25 0x921 3)    ;;20" Style 3
Htm e9=htm("IMG" "images/,DanaInfo=www.jlrvista.franchise.jlrint.com+checkbox_red.gif" "" w4 "0" 26 0x921 3)    ;;21" Style 4
Htm e10=htm("IMG" "images/,DanaInfo=www.jlrvista.franchise.jlrint.com+checkbox_red.gif" "" w4 "0" 27 0x921 3)    ;;21" Style 5
Htm e11=htm("IMG" "images/,DanaInfo=www.jlrvista.franchise.jlrint.com+checkbox_red.gif" "" w4 "0" 28 0x921 3)    ;;22" Style 6

if wheel="20 Style 2"
,if !e7.Checked
,,e7.Click
else if wheel="Grand Black Wood"
,if !e6.Checked
,,e6.Click
else if wheel="Grand Black Wood"
,if !e6.Checked
,,e6.Click
else if wheel="Grand Black Wood"
,if !e6.Checked
,,e6.Click


opt slowkeys 0; opt slowmouse 0; spe -1
;---------------------------------------
Best Regards,
Philip


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)