Same command needs to be performed twice to actually perform it - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Same command needs to be performed twice to actually perform it (/Thread-Same-command-needs-to-be-performed-twice-to-actually-perform-it) |
Same command needs to be performed twice to actually perform it - pistaa - 04-24-2014 Hi! I tried to find similar issues from the forum and via google, but didn't find any. Anyways I'm a beginner with QTP and I need to fix some scripts that have been created by someone else. The scripts are testing a web application (basically entering information to web forms using the QTP datatable). I ran into two scripts where seems to be the same issue; for some reason the data is not entered on a specific field. I checked that the field name etc. is not changed, and if I simply add the same command on the script again the problem is solved. There is an If expression before the command, if that makes any difference. So, basically this doesn't enter the value in the field: Code: If DataTable("p_CarOwner", dtLocalSheet) = "OTHER" Then But once done like this, the information is entered correctly: Code: If DataTable("p_CarOwner", dtLocalSheet) = "OTHER" Then Can anyone explain what is the issue here? Regards, pistaa RE: Same command needs to be performed twice to actually perform it - basanth27 - 04-25-2014 Try to use the debugger to debug the issue. You can then trace the flow and observe the variable values. it could be an issue with blank cell on datatable or simply the inability for the object to set the value. When it traverses the If loop check if the value is returned from the datatable as such, Code: If DataTable("p_CarOwner", dtLocalSheet) = "OTHER" Then Do you get a value you intend to set displayed in the msgbox? If yes, then you may need to learn about Settings.Webpackage("ReplayType"). If a blank value is being displayed then you may want to check your datatable and the cell it is fetching the value from. RE: Same command needs to be performed twice to actually perform it - pistaa - 04-25-2014 Hi, The Setting.WebPackage("ReplayType") seems to solve the issue. Thanks for the help! Regards, pistaa |