wagner1308 Posted June 12, 2009 Share Posted June 12, 2009 hi, I would like to create tests for web application, can someone help me? my browser is Firefox. thanks!!! Link to comment Share on other sites More sharing options...
oMBRa Posted June 12, 2009 Share Posted June 12, 2009 what do you mean with "test"... and you should do a more specific question Link to comment Share on other sites More sharing options...
wagner1308 Posted June 12, 2009 Author Share Posted June 12, 2009 what do you mean with "test"... and you should do a more specific questionhi oMBRa, I'm creating the script for testing web applications with autoit, automating the testing of my application.But I'm having trouble creating this test because it is an application that runs in the browser, I found a library called FF.au3 and I am trying to use some functions that exist in that library.I use the function _FFclick ($ sElement, $ sMode = "elements", $ iIndex = 0) but I see the following error message:_FFClick ==> No match: $sElement: window.content.document.getElementById('kindOfbutton_button_10_divExt')I'm using Firebug to get id, class, name, tagBut still I get this error messagethanks!!! Link to comment Share on other sites More sharing options...
oMBRa Posted June 12, 2009 Share Posted June 12, 2009 hi oMBRa, I'm creating the script for testing web applications with autoit, automating the testing of my application.But I'm having trouble creating this test because it is an application that runs in the browser, I found a library called FF.au3 and I am trying to use some functions that exist in that library.I use the function _FFclick ($ sElement, $ sMode = "elements", $ iIndex = 0) but I see the following error message:_FFClick ==> No match: $sElement: window.content.document.getElementById('kindOfbutton_button_10_divExt')I'm using Firebug to get id, class, name, tagBut still I get this error messagethanks!!!never thought about posting some code? Link to comment Share on other sites More sharing options...
wagner1308 Posted June 12, 2009 Author Share Posted June 12, 2009 never thought about posting some code?I can not post the code, but I will try to explain what I do:I have a web application, I access this application via browser "that I do, now I try to click buttons, fill out forms that can not. For that I'm using libraries that I found here as FF.au3 and web.au3you can imagine a site try clicking on their buttons, fill out your form among other thingsthanks!! Link to comment Share on other sites More sharing options...
avery Posted June 12, 2009 Share Posted June 12, 2009 I can not post the code....Aww why not? www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org Link to comment Share on other sites More sharing options...
oMBRa Posted June 12, 2009 Share Posted June 12, 2009 what do you want from us? Link to comment Share on other sites More sharing options...
wagner1308 Posted June 12, 2009 Author Share Posted June 12, 2009 (edited) what do you want from us?I am using this function, try to click a button. but I am not able to make him do his job. expandcollapse popup; #FUNCTION# =================================================================== ; Name ..........: _FFClick ; Description ...: Simulates a click on an element. ; Beschreibung ..: Simuliert einen Klick auf ein Element. ; AutoIt Version : V3.3.0.0 ; Syntax ........: _FFClick($sElement[, $sMode = "elements"[, $iIndex = 0]]) ; Parameter(s): .: $sElement - Element to click on ; $sMode - Optional: (Default = "elements") : ; | elements ; | id ; | name ; | class ; | tag ; $iIndex - Optional: (Default = 0) : Index if $sMode = elements, name, tag ; Return Value ..: Success - 1 ; Failure - 0 ; @ERROR - ; Author(s) .....: Thorsten Willert ; Date ..........: Thu Apr 09 21:18:33 CEST 2009 @846 /Internet Time/ ; Link ..........: ; Related .......: _FFClickXY, _FFImageClick, _FFLinkClick, _FFObjGet ; Example .......: Yes ; ============================================================================== Func _FFClick($sElement, $sMode = "elements", $iIndex = 0) Local $sFuncName = "_FFClick" If Not IsInt($iIndex) Then SetError(__FFError($sFuncName, $_FF_ERROR_InvalidDataType, "(int) $iIndex: " & $iIndex)) Return 0 EndIf Switch StringLower($sMode) Case "elements" If StringLeft($sElement, 7) = "OBJECT|" Then $sElement = StringMid($sElement, 8) Case "id" $sElement = ".getElementById('" & $sElement & "')" Case "name" $sElement = ".getElementsByName('" & $sElement & "')[" & $iIndex & "]" Case "class" $sElement = ".getElementsByClassName('" & $sElement & "')[" & $iIndex & "]" Case "tag" $sElement = ".getElementsByTagName('" & $sElement & "')[" & $iIndex & "]" Case Else SetError(__FFError($sFuncName, $_FF_ERROR_InvalidValue, "(elements|id|name|class|tag) $sMode: " & $sMode)) Return 0 EndSwitch If StringLeft($sElement, 1) = "." Then $sElement = "window.content.document" & $sElement Local $RetVal = _FFCmd("FFau3.simulateClick(" & $sElement & ",0,0);") If Not @error And $RetVal <> "_FFCmd_Err" And $RetVal = 1 Then Sleep(25) Return $RetVal Else SetError(__FFError($sFuncName, $_FF_ERROR_NoMatch, "$sElement: " & $sElement)) Return 0 EndIf EndFunc ;==>_FFClick can you explain me this function _FFClick? Edited June 15, 2009 by wagner1308 Link to comment Share on other sites More sharing options...
Stilgar Posted June 14, 2009 Share Posted June 14, 2009 If you wanna click e.g. on the button "Pesquisa Google" in your example: _FFClick('btnG','name') or in this case: _FFFormSubmit() without any parameters, because it is the first form on this page. If you wanna fill in something to search: _FFSetValueByName('q', 'StringToSearch') jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
wagner1308 Posted June 15, 2009 Author Share Posted June 15, 2009 If you wanna click e.g. on the button "Pesquisa Google" in your example:_FFClick('btnG','name')or in this case:_FFFormSubmit()without any parameters, because it is the first form on this page.If you wanna fill in something to search:_FFSetValueByName('q', 'StringToSearch')The Autoit Window Info tool does not work very well for implementation web. I am trying to use the functions of this library FF.au3 to aplication web. I do not know if this would be the best library for use with web, if anyone has one for me to say thank you. Because these functions do not really work for me Link to comment Share on other sites More sharing options...
Stilgar Posted June 15, 2009 Share Posted June 15, 2009 The Autoit Window Info tool does not work very well for implementation web. I am trying to use the functions of this library FF.au3 to aplication web. I do not know if this would be the best library for use with web, if anyone has one for me to say thank you. Because these functions do not really work for meWhy doesn't the functions work for you? "Doesn't work" isn't a really an exact error description e.g a search in google looks like this: #include <FF.au3> _FFConnect() ; connect to FF _FFOpenURL("google.com") ; open google _FFSetValueByName('q', 'StringToSearch') ; fill in the search-string _FFFormSubmit(); submit the formular is this to complitcated? OK its simpler to use the google-search-API, but it works with all other forms the same way. jEdit4AutoIt PlanMaker_UDF 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