Jump to content

MarvKLM

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MarvKLM's Achievements

  1. Without sending keys, one possible workaround (tested on Chrome only) _WD_ExecuteScript($sSession, "document.body.style.zoom='100%';void(0);") This will only set the current doc zoom, if you navigate to another page or refresh the current website, it will change again to the chrome browser default zoom.
  2. Hi. I think Jos meant to say, change this: $BtnXXX = GUICtrlCreateButton ("xxx", 250, 10, 30, 30) GUISetOnEvent (-1, "xxx") To: $BtnXXX = GUICtrlCreateButton ("xxx", 250, 10, 30, 30) GUICtrlSetOnEvent (-1, "xxx") It's not a Gui, it's a control.
  3. Hi @junkew thank for confirming my suspicious about FindAll. I changed my approach to TreeWalker to find all elements. There are some considerations that you might help me to understand. First the TreeWalker code (from @LarsJ) I'm using: 1 - Consideration on Pane and Document: W7 - FindAll and TreeWalker both works to find all elements using Pane or Document, results are the same when retrieving Document elements. W10 - FindAll works with Pane and Document but fails to find all elements (because of the aria attributes?). TreeWalker only works with Document, if you use Pane the elements in Document are not retrieved (not sure if this should be the correct method, where Pane only shows PaneElements, but in this case Document is also a child of Pane). 2 - Consideration about the CreatePropertyCondition to find the Document: $UIA_ClassNamePropertyId - Chrome_RenderWidgetHostHWND - using these properties to find the Document (both in W7 Chrome and W10 Chrome) will fail if the Document is not on focus. $UIA_ControlTypePropertyId - $UIA_DocumentControlTypeId - using these properties to find the Document (both in W7 Chrome and W10 Edge) works without the Document being on focus, but this fails on Chrome without focus. I could not find the reason that Document object fails on W10 Chrome if it's not on focus. Using TreeWalker I was able to find the text elements but you will see that in W10, Chrome and Edge have some interesting differences: W7 output: W10 Chrome output: W10 Edge output: As you can see TreeWalker in W10 Edge shows similar results to W7 Chrome.
  4. Hi @junkew, thanks for taking your time to make a code example. Unfortunately the results on W10 are still the same, does not matter if I use Document or Pane with FindAll. And based on your example output you have the same bug. Look at "8$sValue1 = UI Automation on W10 - Get all texts in a Chrome document" the 9$ should be the next element to be found, right under the first title. Try to change the text manually like the below image and it will be more clear. Another thing, for some reason if I use "$oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_RenderWidgetHostHWND", $pConditionDoc)" I can't find the oDocument (both W7 and W10), also tried $UIA_AutomationIdPropertyId, only $UIA_ControlTypePropertyId with $UIA_DocumentControlTypeId worked. Let me show my outputs using your example, but looking for all texts. You will notice that in W7 both texts are found but not in W10. I suspect that you are having the same problem. W7 output (first 41 Text Elements): W10 output (first 101 Text Elements): The second text is never found in W10 (capped to 101 elements so you can see the difference, but in my tests I looped through all of them). If you can, please try to manually edit the HTML and change to make a text that is unique and then try to loop and see if you can find it. Again, many thanks.
  5. Hi. Sorry for the delay. @junkew let me answer your questions: The same HTML code for W7 and W10. This is is not just an hyperlink, because this is a text that was hyperlinked (ie. <a> attribute and the text "Browse" [javascript:var a = document.querySelector("#elNavSecondary_1 > a");alert(a.textContent);]). Also, as I said before, the tree shows the attribute STATICTEXT for all hyperlinks correctly. I only used "Browse" hyperlink as an example. The real problem is that FindAll method is not even showing the pure texts of the document. Look at the bellow image, you will see that there are two texts (same content because it's the topic title). FindAll only shows the first text, not the second. I think this could be a MS issue. I have two machines, one older with W7 (everything working properly) and a new Notebook that came with W10 21H2. So I can't compare with older versions of W10 to know if there is a problem with the new W10 build 21H2. @LarsJ I think that this is some MS bug, because if I try to traverse all elements (in my case using FindAll and TextControl types only) of the document and print all valid $UIA_NamePropertyIds, it will fail to find the second Text (and it's just a text, there are no other control property), as I pointed in the above image example. UIASpy uses FindAll or TreeWalker? I have always used FindAll, because the function returns only control elements. The strange is even if I try to find the specific Text element using ($oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "TEXT", $pCondition )) it fails. This is what I see in W10 using UIASpy, if I use FindAll I only see the first title, the second I can't find using it's name $UIA_NamePropertyId or FindAll (I know that in this example case the texts are dupes, but I manually edit the HTML and changed them to be unique for testing purpose).
  6. @junkew the Chrome trees are equal on both platforms. Now on Edge W10 the example attribute of "Browse" shows both HyperlinkControl and TextControl: But I still can't find it using FindAll (TextControl) on Edge W10. And I have no idea why they change the control name to Group or why Chrome only shows one attribute. @LarsJ I wasn't able to find anything either. Do you get the same fail FindAll results on W10 21H2?
  7. Hi @junkew and @LarsJ, first thanks for the help. Answering junkew questions: Both machines with W7 and W10 OS and Chrome are x64 versions. Compiling the script in x64 does not change anything. On both cases (W7 and W10) Chrome does show the ROLE_SYSTEM_STATICTEXT looking in the accessibility tree. Inspect and UIASpy shows the same results. Some additional information: W10 new install, no AV, no other software, just Chrome x64. What I noticed is that both Inspect and UIASpy on W10 can detect elements that are text only, but not all of them appear immediately in the inspection box, to find some elements it is necessary to manually search the tree to find them. Example: If you inspect at the top of this page for the text element of "Home > AutoIt v3 > AutoIt Help and Support > AutoIt General Help and Support > UI Automation on W10 - Get all texts in a Chrome document", it will show on both tools. But if yout try to find (hovering the mouse) the topic title (UI Automation on W10 - Get all texts in a Chrome document) right under the links paths of the forum, the element does not show on the right side of the inspecting tool, but it's possible to find it manually. Now other elements that should have two attributes like for example a link (HyperlinkControl and TextControl) in W10 are only shown the first one, although the element (Static Text) is appearing in the Chrome accessibility tree. I know you guys are busy, whenever you can help me, that's great. Thanks in advance.
  8. Hi. I can't figure out why the same below example works for fine for me on W7 but it fails to show all texts in W10. I have searched the forum and Google to see if there is something specific to the new W10 build (20H2) but i couldn't find annything. This is the original example i'm using fine in W7: And then I changed some of the static variables for the W10, but both fails to show all text elements. Things I've tried: #RequireAdmin | No AV | Exec as Adm | Change Chrome compatibility on W10 | On W7, for example, inspecting the top of this page, Browse shows HyperlinkControl and TextControl: Now on W10, there are some changes. Custom Control changes to Group and no text. *I'm using the Browse link here as an example where it shows two controls in W7, my intention is to find all text (TextControl). Using the above snippet there many other plain texts in W10 missing, that shows on W7. Using UIASpy in Chrome - W10, I can see the TextControl of the "missing" elements but I can't find them using the above FindAll method.
×
×
  • Create New...