Telerik Forums
Test Studio Forum
7 answers
227 views
I am trying to locate a number of elements which are structurally related to a known element in the hierarchy; in this case, finding all the td cells in a single column of a table. I am trying to use a FindExpression as recommended in the user guide, but it is failing with an error

InnerException:
System.NotSupportedException: Find.All is currently not supported for expressions that have a hierarchal dependency

My code works like this:

HtmlFindExpression expression = new HtmlFindExpression("tagindex=td:3");
IList<Element> foundelements = tablecontrol.Find.AllByExpression(expression);
Note that the expression I am using is very similar to one of the expressions in the user guide (""tagindex=td:0"").

The code compiles without problems, but at runtime it throws the exception as above. What do I need to do to use a find expression to locate the td elements in this way?

P.S. See attachments for a simple worked example.
Elena
Telerik team
 answered on 18 Jun 2018
4 answers
265 views

Does test studio have some feature to achieve this: use test case like a function, create step with custom input parameter.

I know data source can somewhat do this, but it is not flexible.

Suppose we want create a scenario, User A login the system, publish a product, User B login to buy the product, User A login the process the order. A and B can vary from time to time.

Can we easily achieve this by assembling steps?

Elena
Telerik team
 answered on 18 Jun 2018
7 answers
203 views
Hello,
I am just trying out testStudio and created a simple record and playback in which I created a new user account using some our internal website. This test would fail next time because we would throw a 'duplicate account' error. Is there a way to have some kind of teardown/cleanup after a each test case ends in these simple record and playback tests ? What about other more advanced tests ?
Elena
Telerik team
 answered on 18 Jun 2018
15 answers
359 views
I have a folder structure similar to this:
Admin
 - Login
 - Account
    - View project

Where Admin and Account are folders, and Login and View project are tests. The first step in the View Project test is the Login test (using Test as Step). When I move View project to another folder (ie. Misc), I am no longer able to run the View project test, which fails on the first step with the following error:

InnerException:
System.IO.FileNotFoundException: Unable to find test 'C:\path\path\path\Admin\Login.tstest'
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteTestInCurrentContext(String relativeTestPath)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

Do I need to redo the Test as Step steps every time I move a test between folders? Why doesn't the application know where it's been moved to automatically?

Edit: When I re-add my Test as Step, it still returns the error about not being able to find it. My folder structure is actually 3 deep at the point of the View project test, and this only occurred after I moved it into a more nested folder.

Vera
Telerik team
 answered on 14 Jun 2018
1 answer
395 views

Hi,

I am trying to verify a particular cell value in a table. I went through similar questions asked in the past to get the solution.

My "Build Succeded", but "step failed"

HtmlTable T1 = ActiveBrowser.Find.ByXPath<HtmlTable>("//*[@id='ProgramGrid']/div[2]/table/tbody");
HtmlTableCell C1 = T1.Find.ByXPath<HtmlTableCell>("//*[@id='ProgramGrid']/div[2]/table/tbody/tr[2]/td[5]");

Assert.IsTrue(C1.TextContent.Equals("Irish Dunlap"));

 

 

 

Elena
Telerik team
 answered on 13 Jun 2018
3 answers
298 views

Hello,

I am testing out SQL Connection with Telerik code . It's simple function to fetch records from SQL server.

Here is code snippet. When I run telerik test with Coded Step ,It's failing on ExecuteReader() statement with error

"Exception thrown executing coded step: 'Tear Down'.
Incorrect syntax near ')'."

Test compiled fine and there is no syntax error on the output.

 

 

 [CodedStep(@"Tear Down")]
        public void DeleteCreatedAcct_TearDown()
        {
            SqlConnection conn ;
            SqlCommand sqlQuery;
            SqlDataReader  sqlDataSet;
            string  sqlQueryString;
           
                       
            conn = new SqlConnection("data source=DBTEST;initial catalog=DBName ;persist security info=True;user id=usrid;password=pwd");
            //Open SQL Connection
            conn.Open();
                      
            Console.WriteLine("DB Name");
            Console.WriteLine(conn.Database);
           
            //Create SQL Command
            sqlQuery = conn.CreateCommand();         
           
            sqlQueryString = "SELECT AcctId FROM DBtable where UpdatedBy ='Automation Tester')";
           
            Console.WriteLine(sqlQueryString);
           
            //Create SQL query to fetch records
            sqlQuery = new SqlCommand(sqlQueryString , conn);
           
            Console.WriteLine("After sqlQuery.CommandText =sqlQueryString" );
            Console.WriteLine("SQL Parameters" + sqlQuery.Parameters);
           
            Console.WriteLine("BEFORE EXECUTE QUERY");
            sqlDataSet = sqlQuery.ExecuteReader();           <<
failing at this line.
            
            Console.WriteLine("After  sqlDataSet = sqlQuery.ExecuteReader();" );            
            while (sqlDataSet.Read())
            {
                Console.WriteLine("Account ID: " + sqlDataSet["AcctId"] );
            }
            
                    
            
        }

Thanks,

-

Padmashree

 

 

 

 

 

Vera
Telerik team
 answered on 08 Jun 2018
8 answers
530 views

I have a visual studio project that contains a test studio web test.  The test contains coded step.

The project builds.  In Visual studio, I can run it either by

1) highlighting the test file (.tstest), then click on the green play icon to execute the test

2) Select visual studio Test menu, then run -> all test

Either way the test runs and passes.

 

However, when I try to run it from mstest using

%mstest /testcontainer:fullpath\TestStudioProject1.dll

 

I get "No test to execute".

 

What am I missing in the project?

Vera
Telerik team
 answered on 05 Jun 2018
3 answers
107 views

Hi

I am trying to call/execute Test1 in Test 2. Basically I am creating basic  CRUD tests on UI and I have test for Login and trying to below scenarios.

1) Creating Login Test  - Done . I have modularized it and combined login steps into one CodedStep_Login()

2) Creating 'Create' Test - Done

3) Now I want to execute login steps in 'Create' test .  Is it possible to call CodedStep_Login() into Create Test?

   How to verify that Login is passed and if so execute create test.

Appreciate you help.

Thanks,

-

Shree

 

 

 

 

Vera
Telerik team
 answered on 04 Jun 2018
3 answers
139 views

I am having issues with fields being focussed to the top underneath a DIV in our web app. Is this still the only solution?

 

Posted 09 Dec 2015Link to this post
Hello Uroš,

This is a somewhat common problem. Your application has an overlay <div> element at the top of the browser window. Test Studio, when you have SimulateRealTyping, selected always wants to scroll the element to the top of the browser window in order to make sure it's visible in the browsers window before trying to type into the input box. Unfortunately in your case this has the side effect of scrolling it underneath your overlay div.

The only way to over come this is to convert the step to code then comment out the ScrollToVisible line of code, like this:
// Enter text 'passUser' in 'UsernameText'
Actions.SetText(Pages.CAFFA.UsernameText, "");
//Pages.CAFFA.UsernameText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
ActiveBrowser.Window.SetFocus();
Pages.CAFFA.UsernameText.Focus();
Pages.CAFFA.UsernameText.MouseClick();
Manager.Desktop.KeyBoard.TypeText("passUser", 50, 100, true);
The side effect is now you have to take extra care to insure the input box is visible before that step runs. Else typing won't go into that input field.

Vera
Telerik team
 answered on 31 May 2018
8 answers
176 views

Hi all,

we're using Test Studio (ultimate edition, trial version) and we're evaluating if this tool is compliant with our needs.

We are stuck in a particular record sequence: we have a Main window inside of which we have a dialog box overlapped to another one. The issue is that Telerik doesn't record the actions of the top dialog box.

Is it possible to resolve this problem?

Thank you in advance

Christian

Vera
Telerik team
 answered on 30 May 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?