Jump to content

Frame by Frame - Inputing Data - Firefox


IanN1990
 Share

Recommended Posts

Good Afternoon,

With help i am now able to automate one of three websites previously beyond my reach. Using what i have learnt i am trying to automate the last two :)

I learnt to interact with certain fields i need to be inside its frame.

Below is a picture from DOM explorer (May need to fullscreen the picture, as i found the text was blurred)

frame by frame.png

So my target frame (i believe) is Frame RBL. Which is in the Third Block, after RB and R. R and RB are the second frames in their blocks. 

From that i wrote this code;

#NoTrayIcon
#include "array.au3"
#include "FF V0.6.0.1b-15.au3"

_FFConnect()

_FFSetValue("test", "user", "name

_FFFrameEnter(2)
_FFFrameEnter(2)
_FFFrameEnter(1)

_FFSetValue("test", "user", "name")

but it fails.

_SetValue Returns 0,  _FFrameEnter Returns 1.

Am i on the right track?

Edited by IanN1990
Link to comment
Share on other sites

  • 2 weeks later...

I apologize for my delayed response. Work became manic on the run up the Christmas. 

That said, i hope everyone has had a good Christmas  and is looking forward to a positive New Year! :)

On 12/19/2016 at 5:20 PM, junkew said:

any reason you do this thru firefox? 

Image to blurred to say something usefull. Post the parts of the DOM tree in text 

If you do not know where you are going you are on the right track ;-) 

Because i cant control the version of IE i have this causing issues with certain websites.

It seams AutoIt blurs pictures that are quite big, to see it unblurred i opened image in a new tab :)

https://www.autoitscript.com/forum/uploads/monthly_2016_12/5857ffd49c9e6_framebyframe.png.3c70d5062df387dbe4c55420d9a89113.png

On 12/19/2016 at 6:49 PM, Danp2 said:

If you know the name of the frame, then you can lookup by name instead of index:

_FFFrameEnter("RBL", "name")

Also, your code above will never run because the first _FFSetValue is missing a quote and a closing parentheses.

I didn't know you could enter the frame by name, very cool : )

Your correct, the code i wrote into the form was missing a quote!

#NoTrayIcon
#include "FF V0.6.0.1b-15.au3"

_FFConnect()
_FFFrameEnter("RBL", "name")
_FFSetValue("test", "user", "name")

As with before FrameEnter returns 1 and SetValue returns 0.

I don't understand why though?

The Field is a Input with a name="user" and inside frame name = "RBL"

The syntax for _FFSetValue is correct as well.

Link to comment
Share on other sites

I was looking over the DOM Inspector and had a thought.

Do i need to enter the Form as well? As i saw

<Form name="selectUser" action="setup.exe?action=make_rb_fs" encType="application/x-www-form-urlencoded" method="post" target="RB">

I also found this  "Unique Selector", if that is any help? :)

body > center:nth-child(5) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > form:nth-child(2) > table:nth-child(4) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > input:nth-child(1) 

Edited by IanN1990
Link to comment
Share on other sites

Hope you had a happy new year! :)

Unfortunately it yields the same result :(
 

#NoTrayIcon
#include "FF V0.6.0.1b-15.au3"

_FFConnect()
_FFFrameEnter("RBL", "name")
UpdateWebForm("user", "test")

Func UpdateWebForm($cField, $cValue)
    _FFXPath("//form//input[@name='" & $cField & "']")
    _FFCmd("FFau3.xpath.value='" & $cValue & "'")
EndFunc

_FFXPath Returns OBJECT|FFau3.xpath and _FFCmd returns_FFCmd_Err

Edited by IanN1990
Link to comment
Share on other sites

I think my issue is to do with the FrameEnter.

I used firefox right-click option (show only this frame) and _FFSetValue code works inputting data into the field.

I was right :)

#NoTrayIcon
#include "FF V0.6.0.1b-15.au3"
#include "array.au3"

_FFConnect()

_FFFrameEnter("R", "name")
_FFFrameEnter("RB", "name")
_FFFrameEnter("RBL", "name")
_FFSetValue("no", "user", "name")

Works 

Edited by IanN1990
Link to comment
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
 Share

  • Recently Browsing   0 members

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