Flutter Web Automation Test

226 views
Skip to first unread message

Diogo Filho de Morais

unread,
Jan 15, 2020, 3:07:02 PM1/15/20
to Flutter Development (flutter-dev)
We have a problem with web interface testing created with flutter. We are trying to use Selenium and it is not working. Rendered HTML gives us no option to search for the element.

What should we do to run web interface tests?

Rosi Fakalieva

unread,
Jan 16, 2020, 9:46:35 AM1/16/20
to Diogo Filho de Morais, Flutter Development (flutter-dev)
Hey,

You can try to achieve it with Telerik Test Studio https://www.telerik.com/teststudioHere is a short doc article on how you can create tests through the step builder. Here is a bit more info about the workflow with Flutter:

 

  1. Find manually each element in the DOM tree inside Test Studio recorder and add steps and verifications directly from the recorder which will also add the element to the element repository (image 1 from the article).
  2. You can add more steps and verifications later against all recorded elements from within test studio (second image). Here is also a video of this one - https://www.youtube.com/watch?v=pHjqk6nJjn8&list=PLvmaC-XMqeBadBenwSoANlrc57y4bGBVY&index=15


On Wed, Jan 15, 2020, 10:07 PM Diogo Filho de Morais <analise...@gmail.com> wrote:
We have a problem with web interface testing created with flutter. We are trying to use Selenium and it is not working. Rendered HTML gives us no option to search for the element.

What should we do to run web interface tests?

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/9e0b872b-fe23-4572-8248-42d44da1d21a%40googlegroups.com.

Diogo Filho de Morais

unread,
Jan 16, 2020, 11:54:33 AM1/16/20
to Flutter Development (flutter-dev)
I need to write a test with Selenium. I would like to search by field ID or NAME but the HTML that is generated by the flutter has no ID or NAMES as tag attributes. Actually, the HTML that is generated in the flutter is not conventional HTML, but custom. How could I do this using Selenium?

seanjeong

unread,
Aug 5, 2020, 5:00:40 PM8/5/20
to Flutter Development (flutter-dev)
Use AutoIT program (https://www.autoitscript.com/site/)

AuoIt example
AutoIT
MouseClick("left",793,270,1)
Sleep(1000)
Send("seanjeong")
Sleep(1000)

MouseClick("left",1640,469,1)
Sleep(1000)
MouseClick("left",61,433,1)
Sleep(2000)
MouseClick("left",30,179,1)
Sleep(2000)
MouseClick("left",61,433,1)
Sleep(2000)

example

package ThreeMC.Basic;

import java.net.MalformedURLException;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.winium.WiniumDriver;

import login.SeanWebDriver;


public class ThreeMCBasic 
{
private static int result = 9;
private static WiniumDriver driver = null;
    private static ChromeDriver wd = null;
public static void main(String[] args) throws MalformedURLException, InterruptedException 
{
result = 0;

try
{
try
{
System.setProperty("webdriver.chrome.driver", "C:\\selenium\\libraries\\chromedriver\\chromedriver.exe");
wd = new ChromeDriver(); 
wd.manage().deleteAllCookies();
wd.manage().window().maximize();
wd.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
wd.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
SeanWebDriver.waitT(wd, 7000);
}
catch(Exception ex)
{
result += -5;
System.out.println("Test failed. -5");
}
try
{
Runtime.getRuntime().exec("C:\\Selenium\\AutoIT\\AutoIT Record Test Cases\\T21791\\Login.exe");
SeanWebDriver.waitT(wd, 13000);
System.out.println("1");
}
catch(Exception ex)
{
result += -6;
System.out.println("Test failed. -6");
}
//wd.quit();
wd = null;
}
catch(Exception ex)
{
result += -5;
System.out.println("Test failed.");
if(driver != null)
driver.quit();
if(wd != null)
wd.quit();
}
finally
{
if(driver != null)
driver.quit();
if(wd != null)
wd.quit();
}
        System.exit(result);
Reply all
Reply to author
Forward
0 new messages