Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samples don't work if folder name contains '.' #18

Closed
jefleponot opened this issue Mar 7, 2017 · 7 comments
Closed

Samples don't work if folder name contains '.' #18

jefleponot opened this issue Mar 7, 2017 · 7 comments
Labels

Comments

@jefleponot
Copy link

./tagui samples/1_yahoo  firefox
ERROR - use .gui or .txt or no extension for flow filename
ERROR - automation aborted due to above
@kensoh kensoh self-assigned this Mar 7, 2017
@kensoh kensoh added the query label Mar 7, 2017
@kensoh
Copy link
Member

kensoh commented Mar 7, 2017

Thanks @jefleponot for your feedback! Can you tell me more about your execution environment? I can run on my macOS with below output, and for my CentOS server I can run without firefox option.

START - automation started - Tue Mar 07 2017 16:38:55 GMT+0700 (ICT) 

https://www.yahoo.com - Yahoo
 
enter search-box as github 
print search-box - github 
click search-button 
wait 6.6 
snap page 
snap logo 
snap page to results.png 
snap logo to logo.png 
https://duckduckgo.com - DuckDuckGo 
enter search_form_input_homepage as The search engine that doesn't track you. 
wait 4.4 seconds 

https://duckduckgo.com/ - DuckDuckGo 
FINISH - automation finished - 16.2s

@kensoh
Copy link
Member

kensoh commented Mar 7, 2017

To improve on the robustness of the sample flow, I have also updated the flow to explicitly use ca.yahoo.com instead. I think for some users, using yahoo.com might end up serving country-specific versions and the element identifiers will be different.

@kensoh
Copy link
Member

kensoh commented Mar 7, 2017

@jefleponot I looked at the code leading to this error and issue #19, it looks like you may be trying to run it under Windows. As mentioned in the Set Up section, TA.Gui is still in beta and not yet ported to Windows. I'll close this issue but please let me know if there are other reason for the error message!

@jefleponot
Copy link
Author

Hi @kensoh
I test it on Ubuntu 16.04

@kensoh
Copy link
Member

kensoh commented Mar 7, 2017

Hi @jefleponot, will you be able to kindly create a dummy user / account to your Ubuntu so that I can try debugging? I don't have access to a Ubuntu system now, following is the code block which throws the error. What it does is checking for presence of . after removing relative paths and then validates if the file extension is gui or txt.

// check flow filename for .gui or .txt or no extension
$script = $argv[1]; if ($script=="") die("ERROR - specify flow filename as first parameter\n");
if (strpos(str_replace("./","",str_replace("../","",$script)), '.') !== false) // check for extension
if ((pathinfo($script, PATHINFO_EXTENSION)!="gui") and (pathinfo($script, PATHINFO_EXTENSION)!="txt"))
die("ERROR - use .gui or .txt or no extension for flow filename\n");

In the meantime, if you don't have a test user for me to debug, can you try commenting off for example below, and see if any other error messages appear? Hopefully more clues can lead to isolating the root cause of this error message.

// check flow filename for .gui or .txt or no extension
$script = $argv[1]; if ($script=="") die("ERROR - specify flow filename as first parameter\n");
// if (strpos(str_replace("./","",str_replace("../","",$script)), '.') !== false) // check for extension
// if ((pathinfo($script, PATHINFO_EXTENSION)!="gui") and (pathinfo($script, PATHINFO_EXTENSION)!="txt"))
// die("ERROR - use .gui or .txt or no extension for flow filename\n");

I'm reopening the issue as it is happening on Linux-flavor system.

@kensoh kensoh reopened this Mar 7, 2017
@kensoh
Copy link
Member

kensoh commented Mar 7, 2017

Adding on, /src/tagui_parse.php is where above code block comes from, it's the main engine of TA.Gui project where natural language syntax gets parsed into working CasperJS JavaScript code.

UPDATE - if anyone has similar errors with Ubuntu or other Linux distributions please give a shout here, trying to isolate the cause of the error reported by Jef.

@kensoh
Copy link
Member

kensoh commented Mar 13, 2017

Hi @jefleponot, I might have found the cause. Do you happen to install at a directory path containing a '.' in the directory name? If yes it will break, have committed fix that will work now for directory paths containing '.'. Below is the commit message. Let me know if the error message still happens for you!

  • error is likely due to directory path having a '.'
  • eg ta.gui will break while master or tagui is fine
  • amended code to work for directory paths with '.'

@kensoh kensoh changed the title Samples don't work Samples don't work if folder name contains '.' Mar 13, 2017
@kensoh kensoh added bug and removed query labels Aug 28, 2017
@kensoh kensoh removed their assignment Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants