Jump to content



Photo

My loop is stuck on 13 iterations

loop exe stuck error

  • Please log in to reply
15 replies to this topic

#1 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 20 November 2014 - 10:56 AM

Hello Everyone, 

 

Thanks for taking the time to review my issue. I'm still pretty new to building bots, so I'm sure there's something I'm doing wrong in my code:

ui open file("Load Settings File", #open_settings)
ui save file("Create new settings file", #settings)
ui open file("Open content csv file", #content_csv_file)
if($comparison(#open_settings, "!=", "")) {
    then {
        create table from file(#open_settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
if($comparison(#settings, "!=", "")) {
    then {
        add item to list(%settings_location, #settings, "Delete", "Global")
        add item to list(%settings_domain, #domain, "Delete", "Global")
        add item to list(%settings_user, #username, "Delete", "Global")
        add item to list(%settings_pass, #password, "Delete", "Global")
        add item to list(%settings_category, #vid_cat_select, "Delete", "Global")
        add item to list(%settings_tags, #tags, "Delete", "Global")
        add list to table as column(&store_credentials, 0, 0, %settings_location)
        add list to table as column(&store_credentials, 0, 1, %settings_domain)
        add list to table as column(&store_credentials, 0, 2, %settings_user)
        add list to table as column(&store_credentials, 0, 3, %settings_pass)
        add list to table as column(&store_credentials, 0, 4, %settings_category)
        add list to table as column(&store_credentials, 0, 5, %settings_tags)
        save to file(#settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
ui text box("WordPress Domain", #domain)
ui text box("Username:", #username)
ui text box("Password:", #password)
set(#position, 0, "Global")
ui text box("Category to post in:", #vid_cat_select)
ui block text("Add Tags", #tags)
ui stat monitor("Media available in file:", $table total rows(&song_and_title))
ui stat monitor("Media published so far:", #position)
clear table(&song_and_title)
create table from file(#content_csv_file, &song_and_title)
navigate("http://{#domain}/wp-admin/", "Wait")
wait for browser event("Everything Loaded", "")
if($exists(<title="Password Lost and Found">)) {
    then {
        type text(<id="user_login">, #username, "Standard")
        wait(1)
        type text(<id="user_pass">, #password, "Standard")
        wait(1)
        click(<name="wp-submit">, "Left Click", "No")
        wait for browser event("Everything Loaded", "")
    }
    else {
    }
}
wait(2)
loop while($comparison(#position, "!=", $table total rows(&song_and_title))) {
    click(<(title="Add New" AND class="ab-item")>, "Left Click", "No")
    wait for browser event("Everything Loaded", "")
    wait(2)
    click(<href="post-new.php">, "Left Click", "No")
    wait for browser event("Everything Loaded", "")
    wait(2)
    click(<href="#screen-options-wrap">, "Left Click", "No")
    wait(2)
    change attribute(<id="post-song-data-hide">, "checked", "true")
    change attribute(<id="post-video-data-hide">, "checked", "false")
    wait(2)
    click(<id="show-settings-link">, "Left Click", "No")
    wait(1)
    type text(<id="title">, $table cell(&song_and_title, #position, 0), "Standard")
    wait(3)
    click(<(tagname="a" AND id="post-optionst")>, "Left Click", "No")
    wait(2)
    click(<id="are-you-submitting-from-soundcloud_false">, "Left Click", "No")
    wait(2)
    change attribute($element offset(<url field>, 1), "value", $table cell(&song_and_title, #position, 1))
    wait(2)
    click(<(tagname="a" AND innertext="Add Entry")>, "Left Click", "No")
    wait(3)
    click(<id="category-add-toggle">, "Left Click", "No")
    wait(2)
    type text(<id="newcategory">, #vid_cat_select, "Standard")
    wait(2)
    click(<id="category-add-submit">, "Left Click", "No")
    wait for browser event("Everything Loaded", "")
    wait(2)
    type text(<(tagname="input" AND class="newtag form-input-tip")>, #tags, "Standard")
    wait for browser event("Everything Loaded", "")
    wait(2)
    click(<id="publish">, "Left Click", "No")
    increment(#position)
}

No matter what I do when the bot reach 13 iterations everything stops, but the run button remains grey (as if the bot is still running). I have tried while loop, normal loop with table length, etc. I have compiled various bots also. Everything always works 100% as expected until 13 is reached.

 

Attached you can see the csv file containing the title & song url.

 

Thanks for your suggestions.

Attached Files


Edited by askwpcoach, 20 November 2014 - 10:59 AM.


#2 Bot-Factory (Dan)

Bot-Factory (Dan)

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3108 posts
  • LocationEurope/Germany
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 20 November 2014 - 04:30 PM

I just took a very quick look. Without testing it. 
 
But I would add wait at the end of your loop. 
Because at the moment it will do:
click(<id="publish">, "Left Click", "No")
then jump to the top of the loop and do:
click(<(title="Add New" AND class="ab-item")>, "Left Click", "No")
 
And depending on what the site is doing, that might be to fast.
 
I also highly recommend using 
wait for element 
 
This is much more reliable than wait for browser event. 
I would always use wait for element and wait for the exact element I want to click or scrape with my next command.
 
Hope that helps a bit.
 
Cheers
Dan

Signature-JPG.jpg


#3 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 20 November 2014 - 05:18 PM

Hello Dan,

 

Thanks for the suggestion, I added the wait for element at the end of the loop (before the iteration). But I still have the same result, the bot is fully functional and working perfectly until the 13th iteration.

ui open file("Load Settings File", #open_settings)
ui save file("Create new settings file", #settings)
ui open file("Open content csv file", #content_csv_file)
if($comparison(#open_settings, "!=", "")) {
    then {
        create table from file(#open_settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
if($comparison(#settings, "!=", "")) {
    then {
        add item to list(%settings_location, #settings, "Delete", "Global")
        add item to list(%settings_domain, #domain, "Delete", "Global")
        add item to list(%settings_user, #username, "Delete", "Global")
        add item to list(%settings_pass, #password, "Delete", "Global")
        add item to list(%settings_category, #vid_cat_select, "Delete", "Global")
        add item to list(%settings_tags, #tags, "Delete", "Global")
        add list to table as column(&store_credentials, 0, 0, %settings_location)
        add list to table as column(&store_credentials, 0, 1, %settings_domain)
        add list to table as column(&store_credentials, 0, 2, %settings_user)
        add list to table as column(&store_credentials, 0, 3, %settings_pass)
        add list to table as column(&store_credentials, 0, 4, %settings_category)
        add list to table as column(&store_credentials, 0, 5, %settings_tags)
        save to file(#settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
ui text box("WordPress Domain", #domain)
ui text box("Username:", #username)
ui text box("Password:", #password)
set(#position, 0, "Global")
ui text box("Category to post in:", #vid_cat_select)
ui block text("Add Tags", #tags)
ui stat monitor("Media available in file:", $table total rows(&song_and_title))
ui stat monitor("Media published so far:", #position)
clear table(&song_and_title)
create table from file(#content_csv_file, &song_and_title)
navigate("http://{#domain}/wp-admin/", "Wait")
wait for browser event("Everything Loaded", "")
if($exists(<title="Password Lost and Found">)) {
    then {
        type text(<id="user_login">, #username, "Standard")
        wait(1)
        type text(<id="user_pass">, #password, "Standard")
        wait(1)
        click(<name="wp-submit">, "Left Click", "No")
        wait for browser event("Everything Loaded", "")
    }
    else {
    }
}
wait(2)
loop while($comparison(#position, "!=", $table total rows(&song_and_title))) {
    navigate("http://{#domain}/wp-admin/post-new.php", "Wait")
    wait for element(<innertext="Add New Post">, "", "Appear")
    click(<href="#screen-options-wrap">, "Left Click", "No")
    wait(2)
    change attribute(<id="post-song-data-hide">, "checked", "true")
    change attribute(<id="post-video-data-hide">, "checked", "false")
    wait(2)
    click(<id="show-settings-link">, "Left Click", "No")
    wait(1)
    type text(<id="title">, $table cell(&song_and_title, #position, 0), "Standard")
    wait(3)
    click(<(tagname="a" AND id="post-optionst")>, "Left Click", "No")
    wait(2)
    click(<id="are-you-submitting-from-soundcloud_false">, "Left Click", "No")
    wait(2)
    change attribute($element offset(<url field>, 1), "value", $table cell(&song_and_title, #position, 1))
    wait(2)
    click(<(tagname="a" AND innertext="Add Entry")>, "Left Click", "No")
    wait(3)
    click(<id="category-add-toggle">, "Left Click", "No")
    wait(2)
    type text(<id="newcategory">, #vid_cat_select, "Standard")
    wait(2)
    click(<id="category-add-submit">, "Left Click", "No")
    wait for browser event("Everything Loaded", "")
    wait(2)
    type text(<(tagname="input" AND class="newtag form-input-tip")>, #tags, "Standard")
    wait for browser event("Everything Loaded", "")
    wait(2)
    click(<id="publish">, "Left Click", "No")
    wait for element(<innertext="Post published. View post">, "", "Appear")
    increment(#position)
}



#4 Code Docta (Nick C.)

Code Docta (Nick C.)

    Member for Hire

  • Fellow UBotter
  • PipPipPip
  • 1482 posts
  • LocationIn a Python or UBot IDE or ubotdocta.com
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 20 November 2014 - 06:02 PM

Your script looks good except where you use everything loaded, all of them

 

use wait for element as Dan said

 

like the category change

 

I'll bet that it's not being recognized and skipping that step then stops your script

 

you can wait for something to disappear as well and set the time out to something reasonable otherwise it waits like 2 mins is default I think.

 

it's in the advanced part of the node

 

 

HTHelps,

 

CD


UBot Expert Tutorials Store

 

ubot-docta-header-ubot-expert-store.png

 

Python and UBot expert tutorials and documentation


#5 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 21 November 2014 - 06:38 AM

Thanks for your suggestions, the wait for browser event wasn't important so I removed them from the loop. The category change and tags change are very small ajax buttons that submits text (screenshot: http://screencast.com/t/h8uJ9wW9KrY ). The wait for browser event commands are removed but the bot still stops at 13. Will it be helpful if I provide WordPress credentials to you so you can run it from your computer? I will send in private.

ui open file("Load Settings File", #open_settings)
ui save file("Create new settings file", #settings)
ui open file("Open content csv file", #content_csv_file)
if($comparison(#open_settings, "!=", "")) {
    then {
        create table from file(#open_settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
if($comparison(#settings, "!=", "")) {
    then {
        add item to list(%settings_location, #settings, "Delete", "Global")
        add item to list(%settings_domain, #domain, "Delete", "Global")
        add item to list(%settings_user, #username, "Delete", "Global")
        add item to list(%settings_pass, #password, "Delete", "Global")
        add item to list(%settings_category, #vid_cat_select, "Delete", "Global")
        add item to list(%settings_tags, #tags, "Delete", "Global")
        add list to table as column(&store_credentials, 0, 0, %settings_location)
        add list to table as column(&store_credentials, 0, 1, %settings_domain)
        add list to table as column(&store_credentials, 0, 2, %settings_user)
        add list to table as column(&store_credentials, 0, 3, %settings_pass)
        add list to table as column(&store_credentials, 0, 4, %settings_category)
        add list to table as column(&store_credentials, 0, 5, %settings_tags)
        save to file(#settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
ui text box("WordPress Domain", #domain)
ui text box("Username:", #username)
ui text box("Password:", #password)
set(#position, 0, "Global")
ui text box("Category to post in:", #vid_cat_select)
ui block text("Add Tags", #tags)
ui stat monitor("Media available in file:", $table total rows(&song_and_title))
ui stat monitor("Media published so far:", #position)
clear table(&song_and_title)
create table from file(#content_csv_file, &song_and_title)
navigate("http://{#domain}/wp-admin/", "Wait")
wait for browser event("Everything Loaded", "")
if($exists(<title="Password Lost and Found">)) {
    then {
        type text(<id="user_login">, #username, "Standard")
        wait(1)
        type text(<id="user_pass">, #password, "Standard")
        wait(1)
        click(<name="wp-submit">, "Left Click", "No")
        wait for browser event("Everything Loaded", "")
    }
    else {
    }
}
wait(2)
loop while($comparison(#position, "!=", $table total rows(&song_and_title))) {
    navigate("http://{#domain}/wp-admin/post-new.php", "Wait")
    wait for element(<innertext="Add New Post">, "", "Appear")
    click(<href="#screen-options-wrap">, "Left Click", "No")
    wait(2)
    change attribute(<id="post-song-data-hide">, "checked", "true")
    change attribute(<id="post-video-data-hide">, "checked", "false")
    wait(2)
    click(<id="show-settings-link">, "Left Click", "No")
    wait(1)
    type text(<id="title">, $table cell(&song_and_title, #position, 0), "Standard")
    wait(3)
    click(<(tagname="a" AND id="post-optionst")>, "Left Click", "No")
    wait(2)
    click(<id="are-you-submitting-from-soundcloud_false">, "Left Click", "No")
    wait(2)
    change attribute($element offset(<url field>, 1), "value", $table cell(&song_and_title, #position, 1))
    wait(2)
    click(<(tagname="a" AND innertext="Add Entry")>, "Left Click", "No")
    wait(3)
    click(<id="category-add-toggle">, "Left Click", "No")
    wait(2)
    type text(<id="newcategory">, #vid_cat_select, "Standard")
    wait(2)
    click(<id="category-add-submit">, "Left Click", "No")
    wait(2)
    type text(<(tagname="input" AND class="newtag form-input-tip")>, #tags, "Standard")
    wait(2)
    click(<id="publish">, "Left Click", "No")
    wait for element(<innertext="Post published. View post">, "", "Appear")
    increment(#position)
}



#6 Bot-Factory (Dan)

Bot-Factory (Dan)

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3108 posts
  • LocationEurope/Germany
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 21 November 2014 - 06:54 AM

Have you tried disabling all plugins on your wordpress site?
Might be a security / spam plugin that prevents posting a lot of posts in a short period of time?

Dan

Signature-JPG.jpg


#7 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 21 November 2014 - 06:58 AM

:-) I know this may not mean much, but I'm a WordPress developer. I know in detail everything that is in the site and can assure you there are no security triggers. I have been creating small bots to do this type of task and only ran into trouble on this one. 

 

Nothing on the site is broken or disabled, etc... The bot just stops after posting the 13th item no matter what I do.



#8 arunner26

arunner26

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 292 posts
  • LocationBradenton, FL
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 21 November 2014 - 07:26 AM

askwpcoach,

At the office we have a lots of code that has been running well for years.

So when we have a problem we first check the data since the code has proven to be solid for a long time.

 

A couple of suggested test runs I would make with your code:

1. Delete rows 12, 13 and 14. Run the code and see what happens and look for a clue.

2. Sort the input file into descending order. Run the code and see what happens and look for a clue.

 

Sorry that's not much help but it's worth a try.


Andy (Arunner26)

 

 


#9 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 21 November 2014 - 07:53 AM

@Arunner26 Thanks for the recommendation. I started off with 309 items to post, since then I have posted 177 during debugging and running. I have analyzed and changed things around in the data file, but still get the same results. I have run the bot on various computers also.

 

I think I will have no other choice than to finish the job 13 posts at a time :-( . This will take me much longer than I expected when building the bot, but I suppose it is still less time than it would take doing it manually.

 

Thanks again for all of your attempts to help.


Edited by askwpcoach, 21 November 2014 - 07:53 AM.


#10 arunner26

arunner26

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 292 posts
  • LocationBradenton, FL
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 21 November 2014 - 08:01 AM

@Arunner26 Thanks for the recommendation. I started off with 309 items to post, since then I have posted 177 during debugging and running. I have analyzed and changed things around in the data file, but still get the same results. I have run the bot on various computers also.

 

I think I will have no other choice than to finish the job 13 posts at a time :-( . This will take me much longer than I expected when building the bot, but I suppose it is still less time than it would take doing it manually.

 

Thanks again for all of your attempts to help.

 

In that case, you may want to try and put the current loop into a loop,

In the current loop you reduce it to do 10 iterations and in the new outter loop you reset all the variables and lists used and restart the inner loop.

The outter loop continues until all the posts are done.


Andy (Arunner26)

 

 


#11 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 21 November 2014 - 10:34 AM

@Arunner26 Fantastic idea, I have updated my code and running the bot now. I will let you know the result.



#12 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 21 November 2014 - 10:51 AM

@Arunner26 Just finished running the bot, it made it to 14 this time (see screenshot).

ui open file("Load Settings File", #open_settings)
ui save file("Create new settings file", #settings)
ui open file("Open content csv file", #content_csv_file)
if($comparison(#open_settings, "!=", "")) {
    then {
        create table from file(#open_settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
if($comparison(#settings, "!=", "")) {
    then {
        add item to list(%settings_location, #settings, "Delete", "Global")
        add item to list(%settings_domain, #domain, "Delete", "Global")
        add item to list(%settings_user, #username, "Delete", "Global")
        add item to list(%settings_pass, #password, "Delete", "Global")
        add item to list(%settings_category, #vid_cat_select, "Delete", "Global")
        add item to list(%settings_tags, #tags, "Delete", "Global")
        add list to table as column(&store_credentials, 0, 0, %settings_location)
        add list to table as column(&store_credentials, 0, 1, %settings_domain)
        add list to table as column(&store_credentials, 0, 2, %settings_user)
        add list to table as column(&store_credentials, 0, 3, %settings_pass)
        add list to table as column(&store_credentials, 0, 4, %settings_category)
        add list to table as column(&store_credentials, 0, 5, %settings_tags)
        save to file(#settings, &store_credentials)
        set(#domain, $table cell(&store_credentials, 0, 1), "Global")
        set(#username, $table cell(&store_credentials, 0, 2), "Global")
        set(#password, $table cell(&store_credentials, 0, 3), "Global")
        set(#vid_cat_select, $table cell(&store_credentials, 0, 4), "Global")
        set(#tags, $table cell(&store_credentials, 0, 5), "Global")
    }
    else {
    }
}
ui text box("WordPress Domain", #domain)
ui text box("Username:", #username)
ui text box("Password:", #password)
set(#position, 0, "Global")
ui text box("Category to post in:", #vid_cat_select)
ui block text("Add Tags", #tags)
ui stat monitor("Media available in file:", $table total rows(&song_and_title))
ui stat monitor("Media published so far:", #position)
clear table(&song_and_title)
create table from file(#content_csv_file, &song_and_title)
navigate("http://{#domain}/wp-admin/", "Wait")
wait for browser event("Everything Loaded", "")
if($exists(<title="Password Lost and Found">)) {
    then {
        type text(<id="user_login">, #username, "Standard")
        wait(1)
        type text(<id="user_pass">, #password, "Standard")
        wait(1)
        click(<name="wp-submit">, "Left Click", "No")
        wait for browser event("Everything Loaded", "")
    }
    else {
    }
}
wait(2)
loop while($comparison(#position, "!=", $table total rows(&song_and_title))) {
    loop(10) {
        navigate("http://{#domain}/wp-admin/post-new.php", "Wait")
        wait for element(<innertext="Add New Post">, "", "Appear")
        click(<href="#screen-options-wrap">, "Left Click", "No")
        wait(2)
        change attribute(<id="post-song-data-hide">, "checked", "true")
        change attribute(<id="post-video-data-hide">, "checked", "false")
        wait(2)
        click(<id="show-settings-link">, "Left Click", "No")
        wait(1)
        type text(<id="title">, $table cell(&song_and_title, #position, 0), "Standard")
        wait(3)
        click(<(tagname="a" AND id="post-optionst")>, "Left Click", "No")
        wait(2)
        click(<id="are-you-submitting-from-soundcloud_false">, "Left Click", "No")
        wait(2)
        change attribute($element offset(<url field>, 1), "value", $table cell(&song_and_title, #position, 1))
        wait(2)
        click(<(tagname="a" AND innertext="Add Entry")>, "Left Click", "No")
        wait(3)
        click(<id="category-add-toggle">, "Left Click", "No")
        wait(2)
        type text(<id="newcategory">, #vid_cat_select, "Standard")
        wait(2)
        click(<id="category-add-submit">, "Left Click", "No")
        wait(2)
        type text(<(tagname="input" AND class="newtag form-input-tip")>, #tags, "Standard")
        wait(2)
        click(<id="publish">, "Left Click", "No")
        wait for element(<innertext="Post published. View post">, "", "Appear")
        increment(#position)
    }
}

Attached Files



#13 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 21 November 2014 - 11:18 AM

Thanks for all of your attempts to assist. This bot task is now finished, so I no longer need it to work. However I think it may be worth it to say the following:

 

  1. I have created 7 bots on this particular migration project, all of which have had tasks exceeding 300 iterations. None of my other bots have had trouble.
  2. I have run the bot on more than one computer
  3. I have made adjustments to the code

Is there any way I can debug the exe bot just for the sake of learning what I did / went wrong ?

 

Thanks.



#14 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3067 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 22 November 2014 - 02:29 PM

It's hard to say what is going on here. I think you should step through the program (it's going to take awhile  :( ) and see what happens. That's where I would start.



#15 nuc63

nuc63

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 425 posts
  • OS:Windows 8
  • Total Memory:4Gb
  • Framework:v3.5 & v4.0
  • License:Developer Edition

Posted 23 November 2014 - 10:12 AM

My suggestions

 

<1> Wait for element needs a timeout value (bold 15 is wait time, its under advanced settings) wait for element(<title="My Account">, 15"Appear")

 

if you want to know exactly where it freezes or stops you can set a status each step. quick example below

 

<2> set a status after each step to see where it freezes ( don't bother with waits but all other steps)

ui stat monitor("status", #status) 




set(#status, "navigate", "Global")
navigate("http://{#domain}/wp-admin/post-new.php", "Wait")
set(#status, "wait for add post element", "Global")
wait for element(<innertext="Add New Post">, "", "Appear")
set(#status, "click screen options", "Global")
click(<href="#screen-options-wrap">, "Left Click", "No")
wait(2)
set(#status, "change song data", "Global")
change attribute(<id="post-song-data-hide">, "checked", "true")
set(#status, "change video data", "Global")
change attribute(<id="post-video-data-hide">, "checked", "false")
wait(2)
set(#status, "show settings", "Global")
click(<id="show-settings-link">, "Left Click", "No")
wait(1)
set(#status, "type song and title", "Global")
type text(<id="title">, $table cell(&song_and_title, #position, 0), "Standard")

set a variable for # of times to loop using list or table total instead of while.

set(#looptotal, $list total(%list), "Global")
loop(#looptotal) {
}

<3>instead of navigate(, "Wait") use click(<href="post-new.php">"Left Click""No")

 

 

<4>after you publish you need to have a wait as well

 

<5> use defines

 

one for login for posting

 

<6> remove posted entries from table or lists or save the place you are at after each sucessful post



#16 askwpcoach

askwpcoach

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 8
  • Total Memory:More Than 9Gb
  • Framework:v4.0
  • License:Professional Edition

Posted 23 November 2014 - 09:46 PM

@nuc63 Thanks for the instructions, I will update the script and try again tomorrow.







Also tagged with one or more of these keywords: loop, exe, stuck, error

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users