Highlighted
Absent Member.
Absent Member.
448 views

Beginnerquestion

Hi,

I am trying to get started with UFT and have tried to make a first test of a web application. Therefor I built a first test sequence (open website->click button(1)->write into field(2) in next page). Sometimes it works without errors but mostly UFT tells me something like "field(2) webedit is missing". During test there is no change of the website after use of the click button. For this I assume that the real problem isn`t the missing field (2) but the missing click onto the button before.

What is my mistake? Or is it a known bug (sometimes it works and I don`t know why.....)?

Sorry for this beginner question!

Best regards

Fabvan

0 Likes
6 Replies
Highlighted
Respected Contributor.
Respected Contributor.

Hi Fabvan,

Can you share your version of UFT and paste your script here?

Thanks,

Sakthi.K

Regards,
Sakthirajan Kathirvel
0 Likes
Highlighted
Absent Member.
Absent Member.

Hi Sakthi.K,

thanks for your answer!

I am using UFT version 12.54.

In UFT I could generate the attached script, do you mean this?

Here are the sequence steps:

1. Browser("MyWebApp").Page("MyWebApp").WebButton("hotel").Click

2. Browser("MyWebApp").Page("MyWebApp").WebEdit("WebEdit_2").Set("test123")

3. Browser("MyWebApp").Page("MyWebApp").WebButton("search_2").Click

4. Browser("MyWebApp").Page("MyWebApp").WebButton("Web_Button10").Click

5. Browser("MyWebApp").Page("MyWebApp").WebEdit("WebEdit_8").Set"123456789"

6. Browser("MyWebApp").Page("MyWebApp").WebButton("WebButton").Click

Between step 4 and 5 the error occurs. Still being on page of step 4 the message " WebEdit_8 not found" appears. It`s an edit field on the next page, so it is impossible to find it. It seems to be a problem with clicking onto  "Web_Button10". If I click  manually during test sequence everything is ok and the edit box is found. Sometimes it works without doing anything.

Thanks for your help!

Fabvan

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Script content:

Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.Test.Settings.Launchers("Web").Active = True
App.Test.Settings.Launchers("Web").Address = "http://localhost:8080/"
App.Test.Settings.Launchers("Web").CloseOnExit = False
App.Test.Settings.Launchers("Windows Applications").Active = True
App.Test.Settings.Launchers("Windows Applications").Applications.RemoveAll
App.Test.Settings.Launchers("Windows Applications").RecordOnQTDescendants = True
App.Test.Settings.Launchers("Windows Applications").RecordOnExplorerDescendants = False
App.Test.Settings.Launchers("Windows Applications").RecordOnSpecifiedApplications = True
App.Test.Settings.Run.IterationMode = "rngAll"
App.Test.Settings.Run.StartIteration = 1
App.Test.Settings.Run.EndIteration = 1
App.Test.Settings.Run.ObjectSyncTimeOut = 20000
App.Test.Settings.Run.DisableSmartIdentification = False
App.Test.Settings.Run.OnError = "Dialog"
App.Test.Settings.Resources.DataTablePath = "<Default>"
App.Test.Settings.Resources.Libraries.RemoveAll
App.Test.Settings.Web.BrowserNavigationTimeout = 60000
App.Test.Settings.Web.ActiveScreenAccess.UserName = ""
App.Test.Settings.Web.ActiveScreenAccess.Password = ""
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' System Local Monitoring settings
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
App.Test.Settings.LocalSystemMonitor.Enable = false
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Log Tracking settings
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
With App.Test.Settings.LogTracking
    .IncludeInResults = False
    .Port = 18081
    .IP = "127.0.0.1"
    .MinTriggerLevel = "ERROR"
    .EnableAutoConfig = False
    .RecoverConfigAfterRun = False
    .ConfigFile = ""
    .MinConfigLevel = "WARN"
End With

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

you probably need to put

Browser("MyWebApp").Sync

after line 4 so it will wait until the search is finished. 

0 Likes
Highlighted
Absent Member.
Absent Member.

Browser("MyWebApp").Page("MyWebApp").WebButton("hotel").Click
Browser("MyWebApp").Page("MyWebApp").WebEdit("WebEdit_2").Set("test123")
Browser("MyWebApp").Page("MyWebApp").WebButton("search_2").Click
Browser("MyWebApp").Page("MyWebApp").WebButton("Web_Button10").Click
wait 4
Browser("MyWebApp").Page("MyWebApp").WebEdit("WebEdit_8").Set"123456789"
Browser("MyWebApp").Page("MyWebApp").WebButton("WebButton").Click

Where 4's unit is seconds. In case you feel WebEdit_8 is loading after 10 seconds, then put wait 12 and you can use Sync as previously mentioned. Or use descriptive programming for WebEdit_8 if properties are changing each time.

 

+pavan

0 Likes
Highlighted
Absent Member.
Absent Member.

BigDaddy, Pavanpy,

thanks a lot for your answers!!

Fabvan

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.