Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » [SOLVED] How to make if statement if window exists?(How to make if statement if window exists?)
[SOLVED] How to make if statement if window exists? [message #1456354] Thu, 30 October 2014 09:13 Go to next message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
Hi,

i tried to make an if statement that should execute if a window exists but i couldn't handle that yet.
i tried with:

if [get-window Authentifikation | verify-error]-then{}
-else{some Actions}

but it didn't work.
Maybe someone could help me.

Sincerely
Dominik

[Updated on: Wed, 30 September 2015 06:56] by Moderator

Report message to a moderator

Re: How to make if statement if window exists? [message #1456368 is a reply to message #1456354] Thu, 30 October 2014 09:30 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Dominik,

Could you please try the following way:


proc "windowExists" [val window] {
try {
get-window $window
bool true // return true
} -catch {
bool false // return false
}
}


if [windowExists "Authentifikation"]{

log "Window Exists"

}-else {log "Window does NOT exist"}

Please, let us know if it was helpful.

Yours sincerely,
Ulyana.
Re: How to make if statement if window exists? [message #1456376 is a reply to message #1456368] Thu, 30 October 2014 09:42 Go to previous messageGo to next message
Dominik Gabriel is currently offline Dominik GabrielFriend
Messages: 113
Registered: June 2013
Senior Member
Hi Ulyana,

thank you it worked very well. it just seems a little strange to me that a screenshot is taken. and i dont really understand why my solution isnt working Confused

sincerely Dominik
Re: How to make if statement if window exists? [message #1456912 is a reply to message #1456376] Thu, 30 October 2014 21:19 Go to previous message
Francis BACQUET is currently offline Francis BACQUETFriend
Messages: 46
Registered: September 2014
Member
Hi Dominik,

If I am not mistaken,
your solution use a verification function. This functions failed test if the condition is not met. You don't use if statement with them, the verification is good else an error is produced.

Thank Ulyana to "bool true". It also works with int, float and str Shocked .
I have created my own processors just for boolean^^:
proc false {
	let [val var false] {
		$var
	}
}

proc true {
	let [val var true] {
		$var
	}
}

[Updated on: Thu, 30 October 2014 21:53]

Report message to a moderator

Previous Topic:[SOLVED] How to select an Checkbox in Table without index
Next Topic:[HELP] Setting an initial environment once and executing a test suite afterwards
Goto Forum:
  


Current Time: Thu Apr 25 12:28:25 GMT 2024

Powered by FUDForum. Page generated in 0.06407 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top