-2

Login page taking a Email Id and Password. After login there is Logout option is as follows:

enter image description here

Here user's first name is displaying. So now QTP is generates the script as below,

enter image description here

now when I am login from different Email Id and Password at that time how to check the first name is valid or not??

Hexfire
  • 5,945
  • 8
  • 32
  • 42
qaWork4
  • 79
  • 1
  • 6

1 Answers1

0

There are two different things here:

  1. The name of the object being NikunjN, just rename the object (in the object repository) to something generic (UserName). The name (known as "logical name") of an object doesn't effect the test run.
  2. The object's description, you don't show the object's description here, it probably includes the user name and this will be a problem. You need to inspect the object (using UFT's "object spy") and see what properties you can use which don't change between users.
Motti
  • 110,860
  • 49
  • 189
  • 262
  • But I want to check the name came from database is correct or not? – qaWork4 Dec 01 '17 at 07:30
  • Check the First Name in Profile or in data base. – qaWork4 Dec 04 '17 at 04:03
  • @user6350775 you can use UFT's DB capabilities to get the name from the DB and then compare it to the value in the web page – Motti Dec 04 '17 at 07:30
  • But it's mongoDB is used in back end so how can I configure it? – qaWork4 Dec 05 '17 at 04:46
  • @user6350775 UFT supports querying databases via it's [DataBase Output value](http://www.automationtutorial.com/qtpuft/uftqtp-output-values/) feature, I'm not sure if it supports MongoDB. – Motti Dec 05 '17 at 10:43