veerendra Posted November 1, 2013 Share Posted November 1, 2013 Hi i am facing this problem (because i don't know much about autoit). i want generate test log when opening a webbrowser and url blocked or not, url allowed or not. Please give me code webbrowser started if yes means store it as Pass, else Fail. like that i need for url's also. Please show me the way expandcollapse popupGlobal $first $first=_WinWaitActivate("Web Page Blocked!","") Opt("MouseCoordMode",0) #region ---Au3Recorder generated code Start (v3.3.7.0) --- #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc Run('"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"') sleep(1000) _WinWaitActivate("Google - Mozilla Firefox","") sleep(1000) MouseClick("left",269,90,1) sleep(1000) Send("{BACKSPACE}www.yahoo.com{DEL}{ENTER}") sleep(1000) _WinWaitActivate("Web Page Blocked! - Mozilla Firefox","") Sleep(1000) $first=_WinWaitActivate("Web Page Blocked! - Mozilla Firefox","") If $first=_WinWaitActivate("Web Page Blocked! - Mozilla Firefox","") Then MouseClick("left",273,62,1) sleep(1000) _WinWaitActivate("New Tab - Mozilla Firefox","") sleep(1000) MouseClick("left",306,92,1) sleep(1000) Send("www.google.ca{ENTER}") sleep(1000) MouseClick("left",1256,15,1) Sleep(1000) _WinWaitActivate("Confirm close","") Sleep(1000) MouseClick("left",178,115,1) Else MsgBox(0,"Error", "Check the Settings in FortiClient") Exit; EndIf #endregion --- Au3Recorder generated code End --- Link to comment Share on other sites More sharing options...
orbs Posted November 1, 2013 Share Posted November 1, 2013 how about this method - it can be hidden from user, so can also be launched remotely on a pc you want to test, and is more robust because it does not rely on opening windows or simulating clicks. use the IE UDF: _IECreate to open a connection to a website, window is hidden from user. _IEBodyReadText go get some text from the window check the text to see if it contains a typical blocking message by your blocking device. don't forget to _IEQUIT at the end. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
veerendra Posted November 1, 2013 Author Share Posted November 1, 2013 i want to send the result (pass or fail) to excel sheet in to a particular sheet and column. here in my code _winwaitactivate=google then result will be pass and i want "PASS" in to excelsheet in a particular sheet3 and column Link to comment Share on other sites More sharing options...
orbs Posted November 1, 2013 Share Posted November 1, 2013 look the Excel UDF. you can also write the data in CSV text file. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
veerendra Posted November 1, 2013 Author Share Posted November 1, 2013 i tried but i couldn't get the idea, how to use Link to comment Share on other sites More sharing options...
orbs Posted November 1, 2013 Share Posted November 1, 2013 start with a simple example from the help for _ExcelWriteCell(), post your script here and describe the failure, so we can direct you further. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
water Posted November 1, 2013 Share Posted November 1, 2013 Please post the code you use so we can see what doesn't work. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
veerendra Posted November 1, 2013 Author Share Posted November 1, 2013 Send("{BACKSPACE}www.gmail.com{DEL}{ENTER}") sleep(1000) _WinWaitActivate("Web Page Blocked! - Mozilla Firefox","") Sleep(1000) Hi, i need to open a url in mozillafirefox, i want to capture the title of the tab. but i did miskate , the code i attached is recorded one so it not correct for me. please give me line of code to capture title of the tab what it is and i want to pass that value to variable. 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