Closed XiaoluoMax closed 2 months ago
Figure 4 is my code statement and Figure 3 is my run window command, which is stuck in the last sentence. As you can see, I tried to operate RPA to click a button, but it was in the second iframe, so I could not select this element. Is there any good way?
Hi @XiaoluoMax the syntax for subframe is this
frame [frame name] | [subframe name]
steps
frame forwardFrame | mainiframe
steps
More info at the docs - https://tagui.readthedocs.io/en/latest/reference.html#frame
Hi developer, I have tried many times and still can't get me to successfully click on the button element in the iframe, is there any way to print which frame I am currently in ![Uploading 5EF1EA6F-8A3F-4752-87B3-14DA8688E492.png…]()
These are some additional errors, although I don't know what he means
[tagui] INPUT - [62] {"id":62,"method":"Runtime.evaluate","params":{"expression":"var result_bounds = document.evaluate('(//frame|//iframe)[@name=\"mainiframe\" or @id=\"mainiframe\"]',mainframe_context,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).getBoundingClientRect(); var result_rect = {top: Math.round(result_bounds.top), left: Math.round(result_bounds.left), width: Math.round(result_bounds.width), height: Math.round(result_bounds.height)}; result_rect","returnByValue":true}} [tagui] OUTPUT - [62] {"id":62,"result":{"result":{"type":"object","subtype":"error","className":"TypeError","description":"TypeError: Cannot read properties of null (reading 'getBoundingClientRect')\n at
[tagui] INPUT - [63] {"id":63,"method":"Runtime.evaluate","params":{"expression":"subframe_context = document.evaluate('(//frame|//iframe)[@name=\"mainiframe\" or @id=\"mainiframe\"]',mainframe_context,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(0).contentDocument"}} [tagui] OUTPUT - [63] {"id":63,"result":{"result":{"type":"object","subtype":"error","className":"TypeError","description":"TypeError: Cannot read properties of null (reading 'contentDocument')\n at
Hi @XiaoluoMax from above it looks like the subframe cannot be found for some reason. Are you able to access and visit the URL directly for the subframe? If you can you can automate that directly. The URL is the one just below the mainframe line in your first screenshot.
Otherwise, is your website accessible to public so I can have a look? If accessible can you share your code that can show this error?
Hello developer, due to some security issues, the website cannot be opened to the public, but I think it may be the problem of the new TAB page. Which one is right below the first screen shot you mentioned? Please help me point out. As you can see, I first searched the page I need to enter in the search bar (1) of the home page. Then click to enter the search results page (2), and the elements in operation (2) are needed, and the code screenshots are also the elements in leaf page (2). Do I need to use "popup "when switching?
Hi, if your automation is web only, try using the https://www.automa.site
Hello developers, my problem about iframe has been solved, now when I encounter to switch a new TAB page, the URL will change and there is no way to use "popup" to switch
Hi @XiaoluoMax wow, this is tricky. There are 2 ways you can explore.
First way is you just need a small part of URL. Will using below work? It might work if parent page does not have this below in its URL.
popup ifr?page
Second way is are you able to see or read the URL from parent page then visit that page directly instead of using frame?
Developer hello, the first way does not work, the parent page into the child page ulr changes only the "page" behind the variable, is there any way can be opened in the page, get the time variable number, because the number variable of this website is year, month, day, hour and minute seconds, can only wait until the page opens to get the correct variable, Is there anything you can do about the second option The ones that are all numbers are the subpages
It sounds like it can't be automated. If you use visual automation and keyboard() on the popup new tab would it work for your use case? Otherwise I suspect that this scenario is not doable with the tool.
One last thing you can try is after new tab opens up, you do something like below. This forces popup() to point at the new tab because the parent tab is now pointing to google.com and does not have the 'page=' string in the URL.
https://google.com popup page=
I'm sorry I don't understand what you mean, but I think I can restore the situation I encountered. The "page" content of the second subpage is a variable. How should I switch from the first subpage to the second subpage
Hi @XiaoluoMax what I mean is after new tab appears, try the following to see if you can you get access to the new tab -
https://google.com popup page= other steps
But if there is a new tab and another new tab with very similar URLs other than the page ID which is random, I don't think this tool can easily or possibly automate this scenario.
(Closing issue for now but will look out for reply)
Hello developers, some questions about iframe need to ask you Figure 3 is my run window command, stuck in the last sentence Figure 4 is my code statement