This is a migrated thread and some comments may be shown as answers.

Select current day in roster

13 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
F
Top achievements
Rank 1
F asked on 07 Jan 2021, 02:46 PM

Hi,

I've recorderd a test that selects a day in a personel plannings system. The day selected is the 5th of January by clicking on a timeblock/day in the planning application. But when I run the test today or yesterday or tomorrow the exact same day, January 5 is selected. 

I want the test to select the current day every time it runs. So when I run the test on February 7 it should select February 7. But when I run the test on April 14 it should select April 14. 

How can I adjust the test step so that I can run the test every day with  selecting the current day?

 

13 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 08 Jan 2021, 02:51 PM

Hello,

Thank you for sharing details of the case you need to cover - these are helpful for me to provide some insight on the possible approach you can use.

As far as I understand there is a click step, which selects the needed day from a calendar control and you need to adjust this step to click on the current day when the test is being executed. 

For this you will need to combine a coded step getting the current date, setting it to an extracted variable and then use that variable in the find expression of the element in the click step. Here are some additional details on these topics:

  1. Coded step to get the current date - Test Studio allows you to implement any coded solution within coded steps. You can use the .Net DateTime.Today property to get the current day during test runtime.
  2. To use this date, you will need to pass its value to an extracted variable - here is how these variables can be used in code. (As I am not sure if you have used extracted variables so far, let me refer what the straight forward scenario for these is - these can be used to get any dynamically generated data during the test run and use it in the next steps to data bind any input value). 
  3. Once you have defined the extracted variable in code, which holds the current date, you can use this to data bind the find expression of the element, which selects the date from calendar.
    Please, note that this last point is an assumption from my end as I am not completely sure how the test is configured and what the exact steps and elements are. Though, based on the test run outcome you described, I guess that the element from the click step in question, is using the value of the date you select from the calendar in its find expression. 

I hope that this information will help you to adjust the test as per the requirements. Of course, if you need further assistance, or something doesn't seem relevant, please, get back to me with your next queries.

Thank you for your cooperation in advance.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
0
F
Top achievements
Rank 1
answered on 12 Jan 2021, 01:43 PM

Hi,

Thanks for the answer. I'm struggling with creating an extraction step. To select a day or timeframe where I can plan a person, I have so select a rectangle or radwindow. But whichever one I select, the recorder seems to only recognize the main window and not that small backgroudvisualrectangle.And it's that rectangle that needs to be seen as the current day and needs to move up a day when I daily run the test. 

 

Can you help me out?

0
F
Top achievements
Rank 1
answered on 12 Jan 2021, 02:08 PM
I forgot to mention that it's an WPF application
0
Elena
Telerik team
answered on 14 Jan 2021, 03:53 PM

Hello,

Thank you for these additional details.

I think I may have misled you with all information I sent you with my previous reply, so here is some additional explanation. 

The reason I shared the extraction step article was to illustrate how these variables can be used. In the current scenario, however, you don't need to get any data from the application itself. You need to get the current date in a coded step and assign this to a variable. Next will be to use this variable in the elements find expression. (Please, refer to the previously listed articles, if necessary.)

Can you, please elaborate why you are trying to create an extraction step? Am I missing anything in the scenario, which you need to accomplish? Are there are any other difficulties you struggle with? 

In case you need further assistance on the case, it will be important for me to understand how this application works and what is the exact action you need to perform. It will be best if you can provide the application itself and guide me for the scenario - if this is possible, please, note that I don't need to have any actual data maintained in the app, but only to explore its structure.

If this will not be an option, please, record a short video of performing the necessary actions against the application manually - without Test Studio. This will help me understand how the automated part of the app works. 

Then, again while capturing the video, start the test recording and navigate to this schedule part of the application and demonstrate what is the behavior when recording. A

And the last resource to provide will be the test from project, on which you are currently working. Having this I will be able to explore the recorded elements and find the most appropriate solution for this case. 

Thank you once again for your time.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
0
F
Top achievements
Rank 1
answered on 15 Jan 2021, 08:53 AM

Hi Elena,

Thanks for the reply and for the elaboration on the coded step part.

I was trying to create an extraction step because I think I misread your previous reply as a step process to follow. 

Your suggestion about a video is something I'm going to try to make. The thing is that this is a government application so there are some though restrictions to follow.

 

You were talking about me providing the application itself. That is going to be impossible. But how about the locations in the DOM?

 

0
Elena
Telerik team
answered on 15 Jan 2021, 03:22 PM

Hello,

Thank you for getting back to me.

I understand that the application under test may be a confidential one and cannot be shared outside of the organisation. Therefore, if you manage to prepare a video, you can post it in a support ticket, which is a private channel of communication.

Back to the actual topic of discussion - please, take a look at the article, which describes the usage of extracted variables in code. This is the scenario to follow in order to set the today's date in a variable. Then, you can use this variable to assign it to the element's find expression

And as an alternative option for exploring the scenario, you can send me the test you work on - even if you didn't have implemented the suggested coded step yet, it can help me find out more about the elements and if the proposed solution is applicable. Possibly, you can prepare a really short sample test, which navigates to the roster part of the app and select the day on which you had recorded the test. 

As to your question about locating elements in the DOM tree - I guess that this feature can be helpful for you in covering some of the automated scenarios. Do you have any troubles with that? Is there something I can be helpful with in regards this topic?

I hope these additional details will help you in sorting this out. Let me know in case of further questions. 

Thank you for your time.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
0
F
Top achievements
Rank 1
answered on 21 Jan 2021, 09:54 AM

Hi Elenea,

In the attachments I've added my testcase. I don't know if you can see it but there is another issue when running the test.
In the test, step 3 is a right click. This right click opens a RadMenu with Menuoptions. Steps 4 to 6 are wait and verify steps. Those succeed. Step 7 is the click action on one of those menu items.

Running the test fails at step 7. But when I switch to the storyboard I can see that the steps after step 7 run correctly because a shift is created. But when I open the application again, there is no shift. 

So there are a couple of issues:

- it looks like the test studio can't handle the menu that opens with a right click right

- the test does run correctly after the issue above

- the end result looks ok but opening the application after the test has run shows that the end result isn't there.

0
F
Top achievements
Rank 1
answered on 21 Jan 2021, 10:02 AM

I see that I misswrote the part of the storyboard. Here is the correct writing. The storyboard after recording shows that the menu that appears with a right click isn't handeld correct.

 

But when I run the test the menu is show (althought the test fails at step 7) and the steps after that run correct (but are shown with a stopping sign in the results)

0
Elena
Telerik team
answered on 21 Jan 2021, 01:44 PM

Hi,

I reviewed the provided test but I have to admit there isn't much I can find out without the application under test. 

Anyways, there are few suggestions you can test on your end:

  • Enable the annotations for the quick test execution and observe the test run. The annotations will highlight the target element of each step and will help you understand if there is something wrong with the element from the right mouse button menu. 
  • In case the click on this same element seems to happen but the application acts as the item is not clicked, add a click step on this element instead the radmenuoption one. Here is how you can do this: 
    1. Start a recording session with partial test run - you can use the step context menu and the options from the Run... menu (Run->To Here).
    2. Once the application is in the state when the element in question is visible, enable the highlighting and hover over it.
    3. From the highlight menu choose to locate the element in the DOM.
    4. And then, in the Element steps tab, choose a left click from the Mouse Actions section.
    5. An alternative to this approach is to add the step without an active recording session through the step builder. Click on the failing step - this will mark its target element with a red arrow in front in the Elements Explorer
      Select the element and navigate to the Step Builder pane - there you can again choose the Actions section and the Mouse Click options. 

Please, give a try to these suggestions and let me know what observations you see. In case you need further assistance, please, collect the Step Failure details of the failing test and send these for further investigation. These can be exported from the Failure tab

Thank you for your cooperation once again.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
0
F
Top achievements
Rank 1
answered on 22 Jan 2021, 12:56 PM

Hi Elena,

 

Thanks for the answer. I moved on to the next issue. I got the test working for a specific day. Still got to figure out the coded steps. 

But there is also an issue with a pop up window for which the compact recorder toolbar isn't working. The toolbar is connected to that window but when I try to click on either on of the toolbar options the pop up closes. 

 

This pop up window is shown after choosing an option from another pop up window that is shown with a right click on an element. The screenshot named 'Rechtermuis pop up menu is the menu that appears after the right click on an element. The screenshot named 'Toevoegen dienst opties pop up' is the window for which the toolbar is shown but when clicking on a item of the toolbar the window is closed.

 

Hope you can help me out. It's not yet a major issue because with some extra waits I can let the test select an element from this window. But I can't do let's say a verify on the window itself with the highlight and hover over it function of the toolbar.

0
Elena
Telerik team
answered on 27 Jan 2021, 09:42 AM

Hello,

As far as I understand the pop-up is sort of a context menu, which appears after a right click on specific element. As such, it disappears once you have selected an option from it. Please, let me know if my assumption is incorrect. 

Though, if this is the case, here are some tips you might find useful. 

  • Enable the highlighting - as per the specifics of the context menu, you will need to enable the highlighting before you actually trigger the right mouse button. This is how you can then hover over the elements listed in the menu and add verification steps for these. 
  • Add steps from the Step Builder - once you have added any step against an element from the application, there is an element added in the Elements Explorer. Or if you have used the respective option from the highlighting menu and added an independent element to the project. 
    When you choose any element from the Elements Explorer in the context of an opened test, you can add Action and Verification steps from the Step Builder. Such steps can be added even if the application is not running in recording mode - the requirement is to have the target element added in the Elements Explorer. 

I hope that these hints will help you in utilizing the test recording process. Do not hesitate to get back in case you have any further questions. 

Thank you for your time and cooperation.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
0
F
Top achievements
Rank 1
answered on 29 Jan 2021, 09:50 AM

Hi Elena,

 

Your assumption is right. 

I do have the 'Highlighting' on. The highlighting is set on the bigger Radwindow of the screenshot. The highlighting works on the first submenu that appears by a right click.  The issue is with that smaller pop up window that appears after clicking an option from that submenu. I can see that the studio makes a connection with that pop up (the dark overlay with the text 'Connecting to this window'). But the toolbar related to that pop up window closes a soon as I select the 'Highlighting' for that pop up window

0
Elena
Telerik team
answered on 29 Jan 2021, 03:55 PM

Hi,

Thanks for the clarification.

 Based on these details the case seems to be specific for the application under test and this particular control. As previously discussed, probably you will not be able to provide us a sample app, which we can test on our end. 

However, I hope you can generate the application log and send it for further analysis - please, clear or enable this, then start a recording session and reproduce the described misbehavior. Then, collect the logging and send it zipped via this thread. 

If you can prepare a short video with this workflow, it will be of further help.

Thank you in advance for your efforts in our discussion.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Tags
General Discussions
Asked by
F
Top achievements
Rank 1
Answers by
Elena
Telerik team
F
Top achievements
Rank 1
Share this question
or