Moominboy Posted March 22, 2018 Share Posted March 22, 2018 Hi folks Been lurking for a while to build previous scripts but this has me stumped. I'm automating a login via an IBM iSeries data transfer component. This script requires an IF check as a recognised address will go to a standard user/pass form and if its a new address a different window will pop with some more options, and ultimately leads back to the same user/pass prompt. My script is something like; If winexists ("IBM i signon information","Prompt every time") _ Or winactive ("As above", "As above" Then Msgbox ("Entered If Block" ..... ..... ..... Else Msgbox ("entered else block") The if block is never entered and the title, text are exact. I've tried using the handle different visible text. Tried forcing the check for hidden text and child windows. The class of this window is the exact same as every other window used by this exe (#32770) Really at a loss as to why I can't get to pass the IF check. TIA for any help and advice! Link to comment Share on other sites More sharing options...
Moominboy Posted March 22, 2018 Author Share Posted March 22, 2018 Forgot to add images. 😊 I've tried changing the text to search as well as leaving it blank and still no joy. Link to comment Share on other sites More sharing options...
Danp2 Posted March 22, 2018 Share Posted March 22, 2018 A couple of suggestions -- Either remove the "Title:" or wrap the parameter in square brackets. More info here. Try removing the ampersand from the 2nd parameter Bilgus and Moominboy 1 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Earthshine Posted March 22, 2018 Share Posted March 22, 2018 post your real code. pictures don't cut it. Bilgus 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Bilgus Posted March 22, 2018 Share Posted March 22, 2018 (edited) Totally the ampersand, Ive yet to see anything work right trying to match & Also get rid of the spaces at the start of the title WinActive("[TITLE:My Window]", "") next WinWait, WinActive, WinExists, WinWaitActive and their ilk all return a handle to the matched window on success rather than trying to get a match each subsequent time pass the hWnd you already matched Local $hWnd = WinWaitActive(....) ControlClick($hWnd,"", "........") Edited March 22, 2018 by Bilgus Moominboy and Earthshine 1 1 Link to comment Share on other sites More sharing options...
Moominboy Posted March 22, 2018 Author Share Posted March 22, 2018 Thanks all, got it fixed now. The square brackets and ampersand seemed to do the trick. I assumed if autoit could see that actual text with that character then that's what it should be. Really appreciate the quick advice guys, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now