Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automate Spiratest mgt tool to add testcases
#11
Solved: 10 Years, 9 Months ago
Malini -
I regret opening a pandora's box here. Virtual Objects are supposed to be very unstable and ineffective and should be used only in rare case.
You were correct in creating it. Open the OR manager, click on Open, navigate to c:\program files\Mercury Interactive\QuickTest Proffesional\dat\VoTemplate and open the file. You will get the objects added to the Repository.
Use them in your script, It may look like,
Browser().Page().VirtualButton("nameofthebutton").click

PS : I would advise you give up this method if it does not work because persistence with this method kills time and nothing else. This does not signify a hope-less situation.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#12
Solved: 10 Years, 9 Months ago
Hi Basanth,

I will try both methods:
1. first Now I tried to recognize the object just outside the webelement before the click which is a webtable and its recognized...Now, I am trying to extract the cells in the webtable(which are nothing but the webelements).
****till here its working now..
Once I capture the cells, I will check if the cells exist before i perform a click->if exists then click it...after clicking change the properties and then perform the action of copying and pasting the steps and expected results into the cells.
click save...
once this works, I will try te second method of VO..

Thanks,
MaliniWink
I am able to open the virtual object file...and now its got converted to .tsr..Cool


Attached Files
.doc   how to call the virtual objects.doc (Size: 75 KB / Downloads: 44)
Reply
#13
Solved: 10 Years, 9 Months ago
Hi Basanth,
The code is working perfect, I just tested out for 25 test cases..Thanks a ton for your valuable suggestion and such a quick help...

<p>
Code:
For i=50 to 77

datatable.SetCurrentRow(i)
tcname=datatable("testname",dtGlobalsheet)
row1=datatable("steps",dtGlobalsheet)
expres=datatable("expected",dtGlobalsheet)
blank=""
'msgbox(row1)
If Browser("name:=SpiraTest.*").Page("title:=SpiraTest.*").WebEdit("html id:=ctl00_cplMainContent_txtName").Exist Then
    msgbox("testcase name field exists")
    Reporter.ReportEvent micPass,"webedit Check", "webedit Exists"
    Browser("name:=SpiraTest.*").Page("title:=SpiraTest.*").WebEdit("html id:=ctl00_cplMainContent_txtName").Set blank
    wait 2
    Browser("name:=SpiraTest.*").Page("title:=SpiraTest.*").WebEdit("html id:=ctl00_cplMainContent_txtName").Set tcname
    wait 1
    Else
    Reporter.ReportEvent micFail,"webedit Check", "webedit does Not Exist"
End If
wait 1

If Browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").WebElement("WebElement1").Exist Then
    wait 1
    msgbox "webelement exists"
    Browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").WebElement("WebElement1").FireEvent  "onmouseover"
    Browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").WebElement("WebElement1").FireEvent  "click"
    wait 3
else
    msgbox("webelement not exist")
    wait 2
end if

If  browser("SpiraTest | Test Case1").Page("SpiraTest | Test Case1").Frame("Frame").WebElement("WebElement2").Exist Then
    msgbox("After click webelement exists")
    Set oEdit=browser("SpiraTest | Test Case1").Page("SpiraTest | Test Case1").Frame("Frame").WebElement("WebElement2")
    oEdit.object.innertext = row1
    wait 3
else
    msgbox("After click webelement does not exist")
End If
browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").Image("Save and create a new").Click
wait 8
DataTable.SetNextRow
Next

</p>
-------------------------------------------------------------------
Right now the coding is done for the test case entry, the same logic holds for the expected result, which I will implement soon..Cool
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  tool srikanth.gnr 0 1,813 01-05-2012, 12:31 PM
Last Post: srikanth.gnr
  what add-ins should i add... Venkat 1 3,296 03-07-2011, 12:38 AM
Last Post: akbarsharifmd
  Which Add In manager i need to use to automate Eclipse based IDE? laxman_nsn 1 2,732 04-14-2010, 03:55 AM
Last Post: Tarik Sheth
  is webservice add in is different from web add in in qtp? hikpvasanth 1 3,212 10-07-2008, 07:23 PM
Last Post: niranjan
  Whether QTP can be used as the tool to automate Oracle Forms dowloaded via JRE/Jiniti Pradyuman 1 5,405 02-12-2008, 11:44 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)