Jump to content

Recommended Posts

Posted

Hi everyone, I'm learning AutoIt Script and trying to create a script that automates the opening of incidents.

There's some <input> boxes that I need to fill with a text and also some <select> lists, where I choose things like location and department. I believe that clicking on these lists and typing the item desired, I already can get what I want, without opening the list and selecting the <option> ... </option>.

The thing is that all of those things that I wished to get as object, by using "_IEGetObjById" and then _IEAction($object, "click", they are inaccessible because each of them are between <span>  </span>. That's what I think so... So please I need help, I there another way of getting those items as an object and then clicking or typing in them???

Posted

Hellow @FrancescoDiMuro, unfortunately the website is in the intranet... But, anyway, there's a part of the site that's the part where I need to type somethings

image.png.22cb6881fc2eb04a1641118e3d0535a1.png

I've tried this

$idOne = _IEGetObjById($oIE, "Spanwrapper_PrimaryUserTextBox")

_IEDocInsertText($num, "123456")

It didn't work so...

Posted

@Fernandin

The first 3 characters indicate that the text is encoded as UTF8 with BOM (Byte Order Mark) --> Hex : EF BB BF

 

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted
10 minutes ago, Fernandin said:

So is this the reason of not getting the textbox by id as an object? 

Not necessarily.
The command _IEFormElementSetValue itself becomes invalid due to the preceding coding. Type the command in your editor by hand (not by Copy & Paste).

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

Fine, I typed the line on my own and then I got this:

--> IE.au3 T3.0-2 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: PrimaryUserTextbox, Index: 0)
--> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType

 

Isn't the object inaccessible by id and/name because of the <span>?

Posted

Nothing yert...

--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (Spanwrapper_PrimaryUserTextBox)
--> IE.au3 T3.0-2 Error from function _IEGetObjByName, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEFormElementSetValue, $_IESTATUS_InvalidDataType

There's a print screen of the table with the textbox where I pretend to type 

image.png.5e645dea48be93c5191f70929946988e.png

Posted
24 minutes ago, Fernandin said:

--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (Spanwrapper_PrimaryUserTextBox)

This is telling you that the span wasn't found. So now your job is to determine why. You previously posted code where you used an ID of "Spanwrapper_PrimaryUserTextBox". This doesn't exactly match the HTML that you posted (the case is different). Try fixing that and then report back.

P.S. Have you checked to see if the website used frames?

Posted

I've tried those two id that I posted... And talking about frames... I realized that there's a frame that corresponds to the whole window in wich I need to insert things... How do I

deal with that? 

  image.png.85931d940ed406c0bf8926f4fef5a6ab.png

image.png.df67ada052b23570de20ebbd29dc0ac8.png

Posted

Finally, it worked!

$frame = _IEFrameGetObjByName($page, "win_DivLoadIFrame_content") ;I just used this to take the window's frame as an object

$textbox = _IEGetObjById($frame, "PrimaryUserTextbox") ;And then this, taking the textbox inside the frame

Thank you guys for the support.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...