Forum Discussion

Cameronsmith63's avatar
Cameronsmith63
Occasional Contributor
14 years ago

Write to file

Hey There,



I need a method that copy and pastes some text from a webpage, stores it in a variable, and that variable will be used to 

write to a text file.



It seems simple, i just cant figure it out. Sorry for the noob question.



I have provided a pic, and i need the order numbers to be copied out and written to a text file, i got the write to method

 right...I have used that checkpoint option but as new orders come in, the script will fail because TC will be looking for 

the exact value, that being:

Aliases.WinOrbit.FrameForm.ctl_panelMain.ctl_panelWork.HeaderControl.CustomerWorkspace.pnlBrowse.tabWorkspace.TabPage.SupportApplicationControl.panel1.tabControl.TabPage.BrowserControl.containerPanel.SupportApplicationWebBrowser.WebBrowserBaseNativeWindow.ShellDocObjectView.browser.pageViewCustomerOrders.formAspnetform.panelContainer.table.cell.panel.panelCtl00Updatepanel1.panelContent.panelDialogbody.panel.tableCtl00BodyGrdorders.cell.link105015



So as you can see, BodyGrdorders.cell.link105015, 105015 would be a problem because the order numbers change everytime, im trying to make this as dynamic as possible to cater for all, or different order numbers



Regards

6 Replies

  • Cameronsmith63's avatar
    Cameronsmith63
    Occasional Contributor
    Yeah i can't get that method working...but found something that brings me closer to where i am supposed to be.



    Aliases.WinOrbit.FrameForm.ctl_panelMain.ctl_panelWork.HeaderControl.CustomerWorkspace.

    pnlBrowse.tabWorkspace.TabPage.SupportApplicationControl.panel1.tabControl.TabPage.

    BrowserControl.containerPanel.SupportApplicationWebBrowser.WebBrowserBaseNativeWindow.

    ShellDocObjectView.browser.pageViewCustomerOrders.formAspnetform.panelContainer.table.cell.

    panel.panelCtl00Updatepanel1.panelContent.panelDialogbody.panel.tableCtl00BodyGrdorders.cell.link105015



    is what i am supposed to display, or the contents of that cell...well, i receive this error:

    object doesnt support this property or method. Can i convert this to string somehow?
  • Hi,



    What exact code generates the 'object doesnt support this property or method' error?
  • Cameronsmith63's avatar
    Cameronsmith63
    Occasional Contributor
    I think that im receiving this error because TC sees my grid as an object and im trying to write it as string.

    Im using the msgbox control just to see if im displaying the right data.



    Set browser2 = Aliases.WinOrbit.FrameForm.ctl_panelMain.ctl_panelWork.HeaderControl.CustomerWorkspace.pnlBrowse.tabWorkspace.TabPage.SupportApplicationControl.panel1.tabControl.TabPage.BrowserControl.containerPanel.SupportApplicationWebBrowser.WebBrowserBaseNativeWindow.ShellDocObjectView.browser.pageViewCustomerOrders.formAspnetform.panelContainer.table.cell.panel.panelCtl00Updatepanel1.panelContent.panelDialogbody.panel.tableCtl00BodyGrdorders.cell



    adding ".link105015" to the above code, at the end, would give me the cell that i want to be in, but i figured that if i cut it off at "cell" then it would cater for all the different orders numbers in it, not just 105015.





    msgbox browser2



    but once i have the right info, i wont be using that msgbox, just for test pruposes. Anyway, the thing that i am trying to get right is, to get the info out of that specific cell, whether it be the drag option, or something like the above where i can go into the cell, or any other method, then write that to a text file, everything else works besides getting that cell info.
  • Hi,



    You should use one of your object's properties in msgbox, not the object itself. Which property to use depends on what you need to get. For example:

    ...

    msgbox browser2.FullName 'Object's name in the object tree

    msgbox browser2.innerText 'Text the object displays

    'Etc.

    ...




    See the Object Browser for the list of properties.
  • Cameronsmith63's avatar
    Cameronsmith63
    Occasional Contributor
    Thanks a billion, its finally working, who knew it would be that simple.





    Thanks buddy