I wrote a script on A page to direct to B page.
Script as follows:
setHeader Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3
logData 0
navigate http://flights.ctrip.com
sleep 2
setValue id=“DCity1” SHA
setValue id=“ACity1” BJS
setValue id=“DepartDate1TextBox” 2012-09-01
logData 1
navigate exec window.location.href = “【携程机票】飞机票查询,机票预订,机票价格查询,打折特价机票 ”;
And I watch the instance to open the browser.It will first open http://flights.ctrip.com and then go to next page.
But the screen shot get the first page(http://flights.ctrip.com ) even I set logData 0.
I want the next page screen shot.
Is there anything I’m missing?
Help me:huh:~~ Thanks a lot~:P
pmeenan
September 5, 2012, 1:58pm
2
Your last command after the logData 1 is not a valid command. You need to use either a navigate command (with a fixed url) or an execAndWait command (with the corresponding javascript).
Thanks for your reply.
Sorry, I put a wrong script.
My script update as
setHeader Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3
logData 0
navigate http://hotels.ctrip.com
sleep 2
setValue id=txtCheckIn 2012-09-28
setValue id=txtCheckOut 2012-09-30
setValue id=cityId 32
setValue id=cityPY guangzhou
setValue id=hidDistrictCity 32
setValue id=txtCity %B9%E3%D6%DD
exec document.getElementById(“__VIEWSTATE”).name =‘xxx’
exec window.document.forms[0].action = “【携程酒店】酒店预订,酒店价格查询,宾馆住宿推荐,网上订酒店 ”+document.getElementById(‘cityPY’).value+document.getElementById(‘cityId’).value
logData 1
submitForm name’aspnetForm
But it still capture the picture of http://hotels.ctrip.com , instead of next page.
I work well on webpagetest.org website, see http://www.webpagetest.org/result/120905_XA_BRV/
But in my computer, it can’t work.
Is there anything I need to set?