Ask a Question

Click a string variable

SOLVED
SmartBST
Contributor

Click a string variable

Hi have created a variable string for an order # and i need to selected to be able to deleted.

 

How can I complete that .

 

 

Thank  you.

8 REPLIES 8
tristaanogre
Esteemed Contributor

What kind of control are you working with?  Is it a dropdown/select control? A check box? Radio button? Text field?  It really depends upon the kind of control as to what the correct process will be.

 

What I would do, actually, is start first with recording the activity that you want to achieve.  Once that's done, go back to the recorded steps and find where the order string comes into play and add or adjust your code to use the contents of the variable appropriately.

 

Without more specific information, there's very little additional help we can give. Sorry. 😞


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi Robert

 

 

Is a select control

Robert and i have another control that is a text field

@SmartBST Screenshots of the object in question and the code that you've tried would help a lot.  We all test different applications in different languages and it's frustrating for us and you if we have to keep guessing at what the issue is.  Better to give us lots of information than very little.

Marsha,

 

Is this scenario possible to complete doing a keyword test:

 

Search for a specific order#  on a grid by setting up a variable.

Select the variable on the screen.

Record the actions completed.

 

 

 

 

record the action to delete the variable. 

tristaanogre
Esteemed Contributor


@SmartBST wrote:

Hi Robert

 

 

Is a select control


 

Typically, a select control will have a method called "ClickItem".  

 

If I were to write it as code, I'd do something like this:

 

var orderNumber = '12345';

Aliases.MyApp.myForm.mySelectControl.ClickItem(orderNumber);

For a text box, it's simply a matter of passing the variable to either the "Keys" or the "SetText" method.

 

var orderNumber = '12345';

// Keys method
Aliases.myApp.myForm.myTextBox.Keys(orderNumber);

//SetText method
Aliases.myApp.myForm.myTextbox.SetText(orderNumber);

If you're using Keyword Tests, the concept is the same.  When you select the appropriate method on your control (any one of the above 3 as described) you're prompted to enter the parameter value.  If you click the ellipses beside the parameter, you will bring up an edit window.

 

operationparameters.png

 

 

This will allow you to select the mode of "Variable" and select which variable you want to use. This will work for ClickItem, SetText, or Keys.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Thank you very much

cancel
Showing results for 
Search instead for 
Did you mean: