Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem With conversion function
#1
Solved: 6 Years, 1 Month, 2 Weeks ago
Hi, all 

I am  Wajid from USA and new to UFT. I have some problem with my script.

I have written script where I can compare Estimated and actual cost and print Pass or fail result.

My estimated amount is 15700 that changes with every iteration but my actual cost is in currency like $15,700

I have used conversion functions that converts $15,700 to 15700 like Ccur, Cstr, CDbl

When I use above functions on simple test they work properly but when I use them in my script I get Type mismatch error.

I have Created a variable Actual_Price for Actual Price because I am capturing an output from website and the using CAprice variable to convert Actual_Price output.

My script is given below I can share entire script if you want.

Thanks in advance.



Code:
Actual_Price = Browser("Micclass:=Browser","Creationtime:=0","Title:=.*").Page("Micclass:=Page","Creationtime:=0","Title:=.*").webelement("class:=calc-results-total","html id:=ac_max_tmv_result","html tag:=SPAN").GetROProperty("innertext")


Print Actual_Price & "  Before Conversion"

CAprice = Cdbl(Actual_Price)

Print "Actual Price " & Actual_Price  & " Converted Actual Price" & CAprice

Print " and Estimated Price is = " & Estimated_Price

If CAprice = Estimated_Price Then

Print " Actual Price Test Pass"

Else
Print "Actual Price Test Faill"
Reply


Messages In This Thread
Problem With conversion function - by wajid - 09-23-2018, 05:34 AM
RE: Problem With conversion function - by Ankur - 09-25-2018, 03:07 PM
RE: Problem With conversion function - by wajid - 10-01-2018, 05:48 AM
RE: Problem With conversion function - by wajid - 10-01-2018, 01:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,973 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  Pdf to Excel or any other Format Conversion branjitk 1 2,474 06-14-2012, 08:14 AM
Last Post: basanth27
  problem with the function that selects multiple items vijay44 2 2,489 02-06-2010, 10:24 AM
Last Post: vijay44
  problem in wrting function vijay44 1 2,131 02-05-2010, 11:34 AM
Last Post: Saket
  Problem with function call vijay44 2 2,522 01-28-2010, 08:52 PM
Last Post: Anshoo Arora

Forum Jump:


Users browsing this thread: 2 Guest(s)