Not able to set value in WebFile when Windows is locked - 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: Not able to set value in WebFile when Windows is locked (/Thread-Not-able-to-set-value-in-WebFile-when-Windows-is-locked) |
Not able to set value in WebFile when Windows is locked - PrabhatN - 08-19-2010 Hi Guys, I was running a script on a website and in a particular action I faced a problem where the scenario was to upload a document to the site. Following is the process: 1. When I click on a WebButton, a small fixed size browser pops up with a WebFile named "documentfile" and a WebButton named "Upload" inside it. 2. I have to provide the path of the document on the WebFile and click on the "Upload" button. 3. If I leave the WebFile blank and click on the "Upload" button, it shows a warning saying "Provide correct document path" Now when I am running the script in an opened Windows,it is working fine i.e Document is getting uploaded. But when I am running the script and locking the Windows ( By pressing "Windows + L " keys), the warning message "Provide correct document path" is shown, that means the path is not being set on the webfile when Windows is locked. I am providing the document path from Data Table Can anybody come out with a solution to this so that I can run this script in an Locked Windows environment. RE: Not able to set value in WebFile when Windows is locked - guin.anirban - 08-19-2010 Hi Prabhat, It is recommended, not to run the scripts in an Locked Windows environment and if you run you will encounter this kind of problem basically for click event. RE: Not able to set value in WebFile when Windows is locked - PrabhatN - 08-19-2010 But Anirban, You said that basically for "Click" event I'll encounter problem when Script is running in a Locked Windows environment. But in my case, the WebButon is getting clicked, the Browser is popping up, the Upload button is getting clicked. Only thing that is not happening is Setting the document path in the WebFile. I would like to know your opinoin. And why it is recommended that we should not run a script in a Locked Windows environment ? And if we encounter any/many problem(s),then why so ? RE: Not able to set value in WebFile when Windows is locked - sreekanth chilam - 08-19-2010 Hi Prabhat, Try in the below ways & check. Way1: Code: Browser("B").Page("P").WebFile("F").Highlight Way2: Code: Setting.WebPackage("ReplayType") = 2 RE: Not able to set value in WebFile when Windows is locked - PrabhatN - 08-20-2010 Hi Sreekanth, I tried both the ways suggested by you but not able to resolve the issue. I even tried with Setting.Packages.WebPackage.Settings("ReplayUsingSourceIndex") = 0/1, but this also didn't help. Actually my piece of code is as follows: Code: With Browser("Document Upload") The 2 lines colored as blue are two checkpoints on the two webfiles which pass even if Windows is locked. The line colored in red is to set the document path on the webfile which is not setting any value in the webfile The "Upload... " button is getting clicked. So here the only problem is Setting value in the WebFile Please suggest RE: Not able to set value in WebFile when Windows is locked - sreekanth chilam - 08-20-2010 Hi, Refer the below example & try it out and see. Code: x = Browser("B").Page("P").WebFile("F").Object.clientHeight \ 2 RE: Not able to set value in WebFile when Windows is locked - venkatbatchu - 08-23-2010 Hi, As srikanth already gave the all solutions for that if still not working with that then you could use the "Send Keys" as the final option. " My Assumption: After opening the "Dialog Window" if the cursor is focused in "Choose File" edit box then pass the entore path using "Send Keys" Hopefully it will solve this issue. Please let me know for further clarification. Thanks and Regards, Venkat.Batchu |