Jump to content
Sign in to follow this  
cyanidemonkey

website test script with IE.au3?

Recommended Posts

Hi

I am looking at using autoit to automate testing of a website at work with IE.au3 because even though it has been a long time since I have used autoit, I have written a few applications with it and I am not impressed with cucumber as a method of automated testing.

Unfortunately the developer of the website lacked experience and the code is not very 'test' friendly, a lot of page elements do not have ID or Names defined and the employers do not want to put the time/cost into dealing with the technical debt.

My question is, will autoit with IE.au3 be able to find elements by drilling down the HTML DOM tree (if this is the correct term) of a web page?

Any advice would be appreciated.

Cheers,

Marc

Share this post


Link to post
Share on other sites

Well I know that the IE functions included can recognize tables, links, images, and framesets (either frames or iframes) on a webpage. Probably more, but I'm not sure. Browse thru the Help file and see for yorself what can be done with the IE functions. There a several scripts here that can also probably do what you want.

How many pages and how big are the pages that need to be 'corrected'? Depending on that, it shouldn't take more than an hour or so to 'make them right'. Probably less time than it would take to do the research needed to write and then come up with a working script to 'test' the site.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Thanks for reply, I did a little digging though IE.au3 last night and was able to figure out enough to access elements without ID or Name set so will continue using a mix of IE.au3 functions where possible and custom stuff when required.

Both the developers and I would love for the site to be redone properly and have explained the case to the higher ups, but we don't get to make the calls. Business logic vs Developer/Tester logic.

Share this post


Link to post
Share on other sites

Thanks for reply, I did a little digging though IE.au3 last night and was able to figure out enough to access elements without ID or Name set so will continue using a mix of IE.au3 functions where possible and custom stuff when required.

Cool beans man, good luck with your project. B)

 

Business logic vs Developer/Tester logic.

I have found myself in more than one similar situation. When talking to anybody in a suit or with their own office, I have found explaining simply to them that rewriting or correcting any kind process is a better way to do things because whatever the process does now, it'll do better. Better means more things. More things means more money. That usually goes over quite well with them.. B)

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By Seminko
      Hey there,
      below function returns an "object collection" (not sure if that's the correct term) of 'a' elements grabbed from within //*[@id="J_DetailMeta"].
      However, I need the returned collection not to include objects with 'aria-disabled = true'. Is there a way of removing specific objects from such a collection?
      Func GetObjectList($sPicker) $oDetailMeta = _IEGetObjById($oIE, "J_DetailMeta") If Not @error Then $tags = $oDetailMeta.GetElementsByTagName("ul") For $tag in $tags $data_ID_value = $tag.GetAttribute("data-property") If $sPicker = "color" Then If $data_ID_value = '????' Or $data_ID_value = "????" Then $oReturnList = $tag.GetElementsByTagName("a") EndIf ElseIf $sPicker = "network" Then If $data_ID_value = '????' Then $oReturnList = $tag.GetElementsByTagName("a") EndIf ElseIf $sPicker = "storage" Then If $data_ID_value = '????' Then $oReturnList = $tag.GetElementsByTagName("a") EndIf EndIf Next EndIf Return $oReturnList EndFunc $oColorList = GetObjectList("color") For $oColor In $oColorList If StringInStr($oColor.GetAttribute("aria-disabled"), "true") <= 0 Then ; remove object from the collection ??? EndIf Next  
    • By ur
      Any standards or guidelines you can suggest for ui testing of a product.
      I have wrote some code with autoit for basic testing.But I want to make it streamlined and more modularized so that we can add more test cases in future and needed we can change it in a simple manner.
      Any suggestions..
    • By careca
      Hi, i feel im close to getting it to work, but there must be something im missing that's probably easy for you experts.
      #include <IE.au3> #include <File.au3> #include <MsgBoxConstants.au3> $Visible = 1 Local $oIE $oIE = _IECreate("https://beemp3s.net/mp3-download.html", 0, $Visible, 1, 1) _IELoadWait($oIE) If $oIE <> @error Then ;_ArrayText() _QuerySite('Finding Hope - Without You') ;_IEQuit($oIE) ;Exit Else MsgBox(64 + 262144, 'Fail', 'Could not create a new window') EndIf ;============================================================================= Func _QuerySite($Name) Local $oIE_ObjectToSearch = _IEGetObjById($oIE, 'query') _IEDocInsertText($oIE_ObjectToSearch, $Name) Local $oIE_ObjectToClick = _IEGetObjById($oIE, "search-action") _IEAction($oIE_ObjectToClick, 'click') _IELoadWait($oIE, 2000) ;============================================================================= Local $oSubmitClick = _IEGetObjById($oIE, "col-md-12") _IEAction($oSubmitClick, "click") _IELoadWait($oIE, 2000) ;============================================================================= Local $oBtns = _IETagNameGetCollection($oIE, "div") For $oBtn In $oBtns If String($oBtn.classname) = "col-md-12" Then If String($oBtn.innertext) = "Download / Play" Then ConsoleWrite($oBtn.innertext & @CRLF) _IEAction($oBtn, 'click') EndIf EndIf Next ;============================================================================= ;Local $oElements = _IETagNameAllGetCollection($oIE) ;For $oElement In $oElements ; If $oElement.id Then MsgBox($MB_SYSTEMMODAL, "Element Info", "Tagname: " & $oElement.tagname & @CRLF & "id: " & $oElement.id & @CRLF & "innerText: " & $oElement.innerText) ;Next ;============================================================================= ;_IEQuit($oIE) ;Exit ;============================================================================= EndFunc ;==>_QuerySite ;============================================================================= Func _ArrayText() If FileExists('Titles.txt') Then Local $FO = FileOpen('Titles.txt') Local $R2A = FileReadToArray($FO) Local $iLineCount = @extended FileClose($FO) For $f = 0 To $iLineCount - 1 ConsoleWrite($f & ' - ' & $R2A[$f] & @CRLF) _QuerySite($R2A[$f]) Next Else MsgBox(64 + 262144, 'Fail', 'Could not find the file Titles.txt') EndIf EndFunc ;==>_ArrayText ;============================================================================= The idea is to get into this site, write into the search and click, which i did, but now the problem is clicking in any of the buttons in the results page, im looking for a way to click the first one, it always matches to what i want, so no need to fiddle around.
      Site
      Thanks for help in advance.

    • By yoschga
      is there a possibility to let ie.au3 click into a form? i use on a project where i need to click into a form where items are loaded just writing it in or fill the form is no option
       

    • By RamaKrishna9
      What are the minimum system requirements(like Windows OS version, IE browser version, etc,.) for IE.au3(3.3.14.2) to work properly?
×
×
  • Create New...