08-30-2009, 12:51 PM
I am required to add 5000+ testcases into Spiratest mangement tool.
All though I tried using the Excel sheet importer provided by Inflectra to import test cases into SpiraTest, it did not help much since the testcases need to be in the required format. After requesting the team members to enter the testcases into the tool, it was seen that hardly 100 testcases could be entered into the tool a day.
Now, I got the Idea to automate the Spira test, so that it would enter the testcase name, testcase steps and expected result and add a new testcase automatically.
I see the problem where the QTP fails to recognize the WebElement inside the Frame on the page to enter the tescase steps and expected result. The problem I am facing is when the mouse is already in the steps WebElement then the script recognizes the frame and the webelement inside it, else it fails to recognize the frame and the webelement inside.
The script runs first time and fails for the second loop onwards.
Please help...
Following is the code:
Thanks,
Malini
All though I tried using the Excel sheet importer provided by Inflectra to import test cases into SpiraTest, it did not help much since the testcases need to be in the required format. After requesting the team members to enter the testcases into the tool, it was seen that hardly 100 testcases could be entered into the tool a day.
Now, I got the Idea to automate the Spira test, so that it would enter the testcase name, testcase steps and expected result and add a new testcase automatically.
I see the problem where the QTP fails to recognize the WebElement inside the Frame on the page to enter the tescase steps and expected result. The problem I am facing is when the mouse is already in the steps WebElement then the script recognizes the frame and the webelement inside it, else it fails to recognize the frame and the webelement inside.
The script runs first time and fails for the second loop onwards.
Please help...
Following is the code:
Code:
For i=4 to 6
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
browser("SpiraTest | Test Case").Page("SpiraTest | Test Case_2").Frame("Frame").WebElement("WebElement").FireEvent "onmouseover"
browser("SpiraTest | Test Case").Page("SpiraTest | Test Case_2").Frame("Frame").WebElement("WebElement").FireEvent "onclick"
If browser("SpiraTest | Test Case").Page("SpiraTest | Test Case_2").Frame("Frame").WebElement("WebElement").Exist Then
wait 1
'msgbox("in here")
browser("SpiraTest | Test Case").Page("SpiraTest | Test Case_2").Frame("Frame").WebElement("WebElement").FireEvent "onclick"
hWnd = browser ("SpiraTest | Test Case").GetROProperty("hwnd")
'Down Arrow
Window("hwnd:=" & hWnd).Type micDown
Window("hwnd:=" & hWnd).Type micDown
wait 2
'msgbox(row1)
Set oEdit=browser("SpiraTest | Test Case").Page("SpiraTest | Test Case_2").Frame("Frame").WebElement("WebElement")
oEdit.object.innertext = row1
wait 3
else
msgbox("webelement not exist")
End If
'browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").Image("Save and create a new").Click
wait 8
DataTable.SetNextRow
Next
'SaveAndNewIconSelected.gif
'If browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").WebElement("WebElement_2").Exist Then
'
'browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").WebElement("WebElement_2").Click
'wait 1
'Set oEdit1=browser("SpiraTest | Test Case").Page("SpiraTest | Test Case").WebElement("WebElement_2")
'oEdit1.object.innertext = expres
'else
'msgbox("webelement not exist")
'End If
Malini