How to handle this scenerio?

When trying to run script


1. if Window("windowname") Then
2. script.CallScript("login")
3. else
4. browser.close()
5. end if

an error is thrown as -
"a logical expression is required for this statement"
Please someone tell me how can I handle this scenerio?

Questions by rohit131989

Showing Answers 1 - 8 of 8 Answers

It seems that both window and web based elements are used in code. First in If loop you are checking for window(windowname) and then in else browser.close()

Both are different. If possible can you post the correct code.

  Was this answer useful?  Yes

Vijay

  • Aug 23rd, 2011
 

IN if < statement > then

statement must return a logical boolean value (true/false)

if u r trying to check ehether window exists use window("window).exists

or if you are trying to check if the window title has a particular name then try something like this

if (window("window").checkproperty "regexpwndtitle","Window name") then
.......
end if

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions