2929
3030import java .io .File ;
3131
32+ import static org .labkey .test .util .EscapeUtil .getTableViewFormFieldName ;
33+
3234public class AssayImportPage extends LabKeyPage <AssayImportPage .Elements >
3335{
3436 public AssayImportPage (WebDriver driver )
@@ -38,28 +40,28 @@ public AssayImportPage(WebDriver driver)
3840
3941 public AssayImportPage setNamedInputText (String name , String text )
4042 {
41- WebElement input = Locator .input (name ).findElement (getDriver ());
43+ WebElement input = Locator .input (getTableViewFormFieldName ( name ) ).findElement (getDriver ());
4244 new Input (input , getDriver ()).set (text );
4345 return this ;
4446 }
4547
4648 public AssayImportPage selectNamedFieldOption (String name , String text )
4749 {
48- WebElement input = Locator .xpath ( "// select[@name='" + name + "']" ).findElement (getDriver ());
50+ WebElement input = Locator .tagWithName ( " select" , getTableViewFormFieldName ( name ) ).findElement (getDriver ());
4951 new OptionSelect (input ).set (text );
5052 return this ;
5153 }
5254
5355 public AssayImportPage setNamedTextAreaValue (String name , String text )
5456 {
55- WebElement input = Locator .textarea (name ).findElement (getDriver ());
57+ WebElement input = Locator .textarea (getTableViewFormFieldName ( name ) ).findElement (getDriver ());
5658 setFormElement (input , text );
5759 return this ;
5860 }
5961
6062 public AssayImportPage setFileField (String name , File file )
6163 {
62- setFormElement (Locator .input (name ), file );
64+ setFormElement (Locator .input (getTableViewFormFieldName ( name ) ), file );
6365 return this ;
6466 }
6567
@@ -112,7 +114,7 @@ public AssayImportPage selectUploadFileRadioButton()
112114 return StringUtils .trimToNull (text .replace ("[remove]" , "" ));
113115 }
114116
115- var fileInput = Locator .input (fieldName );
117+ var fileInput = Locator .input (getTableViewFormFieldName ( fieldName ) );
116118 if (isElementPresent (fileInput ))
117119 return getFormElement (fileInput );
118120
0 commit comments