Posts: 166
Threads: 57
Joined: Aug 2013
Hi,
I need to input shipment tracking number into a website and find the ETA from it.
I tried using the 'Find HTML element' and 'Find Accessible object' tool.
However the tool is unable to find the input field.
Kindly advise.
Website:
https://www.msc.com/are#
Track A Shipment menu
Booking number / Container number / Bill of ladding field
Regards,
Philip
Best Regards,
Philip
Posts: 1,338
Threads: 61
Joined: Jul 2006
08-06-2018, 02:41 PM
(This post was last modified: 08-06-2018, 05:32 PM by Kevin.)
Find Accessible object and Find Html Element are working np for me on that page
this is the code for Internet Explorer (Find Html Element)
Function
IE_find_html_test
spe -2
int w2=wait(3 WV win("- Internet Explorer" "IEFrame"))
Htm e=htm("A" "TRACK A SHIPMENT" "" w2 "0" 42 0x1 3)
e.Click
0.3
Htm e1=htm("INPUT" "ctl00_ctl00_Header_TrackSearch_txtBolSearch_TextField" "" w2 "0" 7 0x101 3)
e1.SetText("12345b/12345cn/9878bol")
Htm e2=htm("A" "" "<a title=''Search'' class=''button postfix altButtonLight'' id=''ctl00_ctl00_Header_TrackSearch_hlkSearch'' onclick=''Crafted.Site.TrackingProvider.TrackEvent('track a shipment', 'click', 'flyout submit', 'HeaderTracking');'' href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(''ctl00$" w2 "0" 45 0x0 3)
e2.Click
int w=wait(30 WV win("Shipping Container Tracking and Tracing | MSC - Internet Explorer" "IEFrame"))
Htm e3=htm("DIV" "" "<div class=''copyPanel'' id=''ctl00_ctl00_plcMain_plcMain_pnlTrackingResults''>" w "0" 113 0x0 3)
str text=e3.Text
out text
and for chrome (Find Accessible object)
Function
[b]Chrome_find_acc_test[/b]
spe -2
int w1=win("Google Chrome" "Chrome_WidgetWin_1")
Acc a.Find(w1 "LINK" "TRACK A SHIPMENT" "" 0x2011 3)
a.DoDefaultAction;; click track a shipment button
0.3
Acc a1.Find(w1 "TEXT" "" "state=0x100004 0x20000040" 0x2014 3);;opens the dropdown
a1.SetValue("12345b/12345cn/9878bol");;inputs text ..change text inside quotes to whatever you need
Acc a2.Find(w1 "LINK" "Search" "value=''javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(''''ctl00$ctl00$Header$TrackSearch$hlkSearch'''', '''''''', true, ''''HeaderTracking'''', '''''''', false, true))''" 0x2004 3)
a2.DoDefaultAction
0.3
int w=wait(30 WV win("Shipping Container Tracking and Tracing | MSC - Google Chrome" "Chrome_WidgetWin_1"))
Acc a3.Find(w "H3" "" "" 0x2010 30)
str text =a3.Name
out text
also for chrome , make sure Enable chrome acc when it starts is checked in QM Options(Tools- Options -- General Tab)
Posts: 1,338
Threads: 61
Joined: Jul 2006
after doing some further checking acc and htm are giving different results on win7 compared to win10
redid the code on win7 and works on both computers now