cancel
Showing results for 
Search instead for 
Did you mean: 

Pop-up identification

Former Member
0 Kudos

Good day,

I have 2 pop-up windows that can appear when my script is running. Each pop-up needs to be handled differently.

#1 session.findById("wnd[1]/usr/txtMESSTXT1").text

#2 session.findById("wnd[1]/usr/.txtSPOP-TEXTLINE1).text

Is there a code to identify which pop-up has appeared so that if pop-up #2 appears instead of #1, the script won't debug?

I have tried an if statement that identifies the pop-up based on the text within the box but that has failed dismally.

Please assist

Accepted Solutions (0)

Answers (1)

Answers (1)

stefan_schnell
Active Contributor
0 Kudos

Hello Chimane,

welcome in the Scripting Language forum.

Has your pop-up window a title? If so, you can differentiate the pop-up windows on this point.

If session.findbyid("wnd[1]").Text = "Title Pop-Up Window 1" Then

  'Do something

ElseIf session.findbyid("wnd[1]").Text = "Title Pop-Up Window 2" Then

  'Do something other

End If

Are there other differences between the pop-up windows, e.g. buttons, labels? It is also possible to differentiate it on this points.

Let us know your results.

Cheers

Stefan

Former Member
0 Kudos

Hi Stefan,

It worked perfectly , I used the title of the pop-up as per your code.Thanks for the prompt response.

Rgds

Chimane