Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to set value in WebFile when Windows is locked
#1
Not Solved
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.
Reply
#2
Not Solved
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.
Reply
#3
Not Solved
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 ?
Reply
#4
Not Solved
Hi Prabhat,

Try in the below ways & check.

Way1:
Code:
Browser("B").Page("P").WebFile("F").Highlight
Browser("B").Page("P").WebFile("F").Set "Document Path"

Way2:
Code:
Setting.WebPackage("ReplayType") = 2
Browser("B").Page("P").WebFile("F").Set "Document Path"
Setting.WebPackage("ReplayType") = 1
Reply
#5
Not Solved
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")
        .WaitProperty "name", "Document Upload", 20000
        [color=#0000CD].Page("Document Upload").WebFile("documentfile").Check CheckPoint("documentfile")
        .Page("Document Upload").WebFile("webdocumentfile").Check CheckPoint("webdocumentfile")[/color]
        [color=#FF0000].Page("Document Upload").WebFile("documentfile").Set DataTable("DocumentFilePath_In",dtLocalSheet)[/color]        
.Page("Document Upload").WebButton("Upload...").Click
End With

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
Reply
#6
Not Solved
Hi,

Refer the below example & try it out and see.

Code:
x = Browser("B").Page("P").WebFile("F").Object.clientHeight \ 2
y = Browser("B").Page("P").WebFile("F").Object.clientWidth - 5
Browser("B").Page("P").WebFile("F").Click x,y
Browser("B").Dialog("text:=Choose file").WinEdit("attachedtext:=Filename","nativeclass:=Edit").Set DataTable("DocumentFilePath_In",dtLocalSheet)
Reply
#7
Not Solved
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to make QTP Script to work when system gets locked? ramkumarad 6 12,420 11-02-2017, 03:37 PM
Last Post: Divv
  Webfile.set is not working in QTP 11 for chrome browser version 24 pradeep singh 1 5,079 11-05-2014, 11:51 AM
Last Post: mansoor.s.shaikh
  System getting locked Anand Saboo 4 3,672 10-24-2013, 05:09 PM
Last Post: Anand Saboo
  Running QTP scripts while host computer is locked jreelest 5 7,973 10-24-2013, 01:25 PM
Last Post: Anand Saboo
Shy Data Table Cells getting locked when test is saved to QC. How to prevent this anil2u 2 5,213 09-21-2012, 09:35 PM
Last Post: npdqa

Forum Jump:


Users browsing this thread: 4 Guest(s)