Highlighted
Absent Member.
Absent Member.
1369 views

How to get text from alert popup using TruClient protocol

Hi,

I'm hoping someone can help or point me towards a post with the solution (I've searched but didn't come up with anything that exactly matched my query)

 

Using Loadrunner version 12.53  and the TruClient protocol to test our product. For the most part all is well but one thing I'd like to do is verify the contents of an alert dialog. For example, I create an item and then select the cancel function. A dialog alert then pop-ups to state "Cancel requisition entry and lose any changes?". I'd like to verify that the text displayed matches my expected text.

In selenium this is straight forward by the following code (but is it possible in loadrunner?):

//Get Cancellation alert text
IAlert alert = driver.SwitchTo().Alert();
//Console.WriteLine(alert.Text);
string actualvalue = alert.Text;
Assert.IsTrue(actualvalue.Contains("Cancel requisition entry and lose any changes?"), actualvalue + "Doesn't contain 'Cancel requisition entry and lose any changes?'");

hoping someone can advise

thanks

0 Likes
5 Replies
Highlighted
Established Member..
Established Member..

Re: How to get text from alert popup using TruClient protocol

Hi,

Try the below steps to capture text from alert pop-up window:

1) Add a Generic Object Action from tool box and select the text area by "Click to choose an object" method

2) Change the Action in the Step dropdown from "Click" to "Get Property"

3)  In Argument section, select "visible text" from Property drop down and provide a name in variable section.

Alternatively you can also try this,

1) Change the end event to "Object Exists" within your action Step.

2) Highlight the text area in the pop-up window you want to capture

In this way you can validate if you got the right text from the user action resulting in alert pop-up window.

Hope this clarifies your query. Also let know if either of the above ways worked for you.

Thanks,

Bibhu Panda.

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to get text from alert popup using TruClient protocol

Hi,

Unfortuntaely it is not doable today with TruClient. TruClient allows getting text from DOM elements or HTML popups but not from browser dialogs (alert, confirmation, prompt).

Please submit an enhancement request and it will be considered to be addressed in future releases.

Regards,

Shlomi

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: How to get text from alert popup using TruClient protocol

Thanks Shlomi,

I suspected that was the case. I'll raise the enhancement request.

regards

Simon

Highlighted
Absent Member.
Absent Member.

Re: How to get text from alert popup using TruClient protocol

Thanks for the reply bibhu. Unfortunately it didn't work for me

Simon

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: How to get text from alert popup using TruClient protocol

Hi,

I have the same problem in a TruClient script recorded in 12.63.  Is there a patch for this?

Thank you.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.