Answered

Issue with Verifying web elements/text in frame

Hello, I am having an issue with verifying web elements/text in a particular frame after using Switch_Frame. Other frames' Switch_Frame commands used and subsequent test steos in the same test case work but this one.

Test case name/ID - PM_Checklist_NIH_NHLBI/10917

Failed test steps - 45, 46

Errors - 

45 - Text '5R01HL105495-09' not present
 


46 - Failed to locate element after 1 attempt(s) with interval in 1 second(s). Locator 'Checklist_Questions.link.CurrentChecklistAWR' not found
Possible causes: timeout, wrong locator definition or flow landed on the wrong page either due to application exception or wrong navigation from previous step.
no such element: Unable to locate element: {"method":"xpath","selector":"//a[@title='Go to current Award Worksheet Report']"}
Driver: Chrome Driver
Driver verison: 88.0.4324.96
Search method: xpath
Search value: '//a[@title='Go to current Award Worksheet Report']'

 

 

  •  
0
10 comments
Avatar
Joseph Hamdan

Hi Stephen,
For Verify_Element command:
1- When using Switch_Frame, is the option "Whole test case" selected next to Switch Duration?
2- Instead of using Switch_frame, did you try using the Frame field in the locator form to specify the frame?
3- Could you please verify that the frame XPath is correct?


For Verify_Text command:
1- Is the frame created under the command (with the XPath added to the locator) ?
2- Could you please verify that the frame XPath is correct?
Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Stephen Akinpelumia

Hi Joseph, please see my responses below, let me knwo if we can have a GoToMeeting or Webex session so that i may demo the issue...

For Verify_Element command:
1- When using Switch_Frame, is the option "Whole test case" selected next to Switch Duration?

Yes.
2- Instead of using Switch_frame, did you try using the Frame field in the locator form to specify the frame?

The elements in the function are used in other version of the application that does not have Frames, hence the need to use Switch_Frame. I did try to create a frame element to reference in the Frame field and got the same error.
3- Could you please verify that the frame XPath is correct?

Yes, //div/div/div/iframe[contains(@src, 'myNhlbiChecklist.era?')]. I have done multiple versions of the xapth (both relative and absolute and while it passes the Switch_Frame command, it does not find any elements after that.


For Verify_Text command:
1- Is the frame created under the command (with the XPath added to the locator) ?

I have tried that, no change.
2- Could you please verify that the frame XPath is correct?

Yes, //div/div/div/iframe[contains(@src, 'myNhlbiChecklist.era?')]. I have done multiple versions of the xapth (both relative and absolute and while it passes the Switch_Frame command, it does not find any elements after that.


Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Stephen,

Thank you for the explanation.

Would it be possible to send part of the DOM that includes the text, element around it and frame (if there are inner and outer frames, both need to be specified in the locator)?
We will investigate this further.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Stephen Akinpelumia

please see html of the frame and screenshots below, the elements with arrows are the ones failing on steps 45 and 46; there are many other elements in this frame that will be ran against. Let me know if we can have a GoToMeeting or Webex session so that I may demo the issue...

<iframe src="https://apps.test.era.nih.gov/pmm/myNhlbiChecklist.era?lang=en_US&amp;owf=true&amp;themeName=nhlbi-test&amp;themeContrast=black-on-white&amp;themeFontSize=12" frameborder="0" name="{&quot;id&quot;:&quot;8554e499-614a-4fd9-9e7d-62591c95ea27&quot;,&quot;containerVersion&quot;:&quot;7.15.1&quot;,&quot;webContextPath&quot;:&quot;/owf&quot;,&quot;preferenceLocation&quot;:&quot;https://intoneview.nhlbi.nih.gov/owf/prefs&quot;,&quot;relayUrl&quot;:&quot;https://intoneview.nhlbi.nih.gov/owf/js/eventing/rpc_relay.uncompressed.html&quot;,&quot;lang&quot;:&quot;en_US&quot;,&quot;currentTheme&quot;:{&quot;themeName&quot;:&quot;nhlbi-test&quot;,&quot;themeContrast&quot;:&quot;black-on-white&quot;,&quot;themeFontSize&quot;:12},&quot;owf&quot;:true,&quot;layout&quot;:&quot;fit&quot;,&quot;url&quot;:&quot;https://apps.test.era.nih.gov/pmm/myNhlbiChecklist.era&quot;,&quot;guid&quot;:&quot;3h2kfovo-f94h-21fr-ed21-ke32i8cde2u1&quot;,&quot;version&quot;:1,&quot;locked&quot;:true,&quot;urlProperties&quot;:{}}" title="{&quot;title&quot;:&quot;eRA CheckList&quot;}" id="{&quot;id&quot;:&quot;8554e499-614a-4fd9-9e7d-62591c95ea27&quot;}" class="x-component x-fit-item x-component-default" role="presentation" style="margin: 0px; width: 623px; height: 452px;" cd_frame_id_="ff775dc3f9089f25840ebef00f0d29f9"></iframe>

0
Comment actions Permalink
Avatar
Stephen Akinpelumia

Hello, as per provided recommendations; I skipped all the SWITCH_FRAME steps (i.e. Step 21, 

Switch_Frame HALT to frame with xpath="//div/iframe[contains(@title, 'Grants Application List')]" using whole test case switch duration)
 

and now it fails at Step 22 with the following error below..

 
Failed to locate element after 10 attempt(s) with interval in 2 second(s). Locator 'MyNHLBI_Checklist_Type5_GrantsApplList.Select.POName' not found
Possible causes: timeout, wrong locator definition or flow landed on the wrong page either due to application exception or wrong navigation from previous step.
no such element: Unable to locate element: {"method":"css selector","selector":"#poName"}
Driver: Chrome Driver
Driver verison: 88.0.4324.96
Search method: id
Search value: 'poName' Initially specified limits have been overridden. New Attempts Amount: 10. New Interval: 2 second(s)

 

.. where now the web element in step 22 is no longer recognized, when the SWITCH_FRAME is used in Step 21 it does pass.

I am available today or tomorrow for a Gotomeeting with anyone that wished to get more information on this, thanks.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Stephen,

Could you please let us know which test case (path and name) includes the latest changes that you made?

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Stephen Akinpelumia

PM_Checklist_NIH_NHLBI_Test, Test case id 10953.

0
Comment actions Permalink
Avatar
Payam Fard

I am not able to get to step 22. Step 20 of that test case is failing for me. The first switch_frame in this test case is step 32. Is the above mentioned test case correct and consistently passing? Are the step numbers referenced correct as I am seeing something different. I appreciate if you could please provide accurate information for this test case so that we can try to provide a resolution.

0
Comment actions Permalink
Avatar
Stephen Akinpelumia

Hi Payam, Step 20 (Verify_Element HALT exist MyNHLBI_Checklist_Type5_GrantsApplList.Select.POName 30 2 off off) is failing because it is inside a frame (please see screenshot below).

In the original test case (PM_Checklist_NIH_NHLBI/10917), I used step 21 (Switch_Frame HALT to frame with xpath="//div/iframe[contains(@title, 'Grants Application List')]" using whole test case switch duration) to acces the frame prior to clicking the MyNHLBI_Checklist_Type5_GrantsApplList.Select.POName locator and it worked; there are 7 other steps in the original test case that used the SWITCH_FRAME command and it worked with no issues except for Steps 45/46, in the test case that does not have any SWITCH_FRAME commands multiple steps like step 20 will fail.

I recommend that we have a GoToMeeting with anyone available on this, based on your availability. Thanks.

 

 

 

0
Comment actions Permalink
Avatar
Stephen Akinpelumia

Thanks Subject7 for the provided workaround with the nested iframe, I am able to verify elements in the affected frame now.

0
Comment actions Permalink

Please sign in to leave a comment.