私はセレンの自動化に取り組んでいます。 私のチームはテストデータ用にxmlファイルを使用しています。 xmlファイル内のテストデータは、Beanとプロパティのようになります。xmlファイルにBean IDを取得する方法はありますか
各ビーンは、1つのテストケースのデータになります。テストケースでは、私たちは「postpaidTC1」豆のデータを使用します今
ApplicationContext ctx = new ClassPathXmlApplicationContext("/PostPaidRegistration.xml");
RegistrationBean user = (RegistrationBean)ctx.getBean("postpaidTC1");
:
は今、私たちは以下のような各Beanと各@Testメソッドを作成しています。
ApplicationContext ctx = new ClassPathXmlApplicationContext("/PostPaidRegistration.xml");
RegistrationBean user = (RegistrationBean)ctx.getBean("postpaidTC2");
は、私は、代わりにXMLでBeanの多くの@Testメソッドを作成するのではなく、すべてのBean(テストデータ)を実行する方法を知ってほしいと私たちは別の@Testメソッドを記述し、別のテストケースのため
BeanIDを取得することでループとして単一の@Testメソッドを持つxmlに追加します。
私のXMLは以下のようなものです:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
http://www.springframework.org/schema/data/repository
http://www.springframework.org/schema/data/repository/spring-repository-1.0.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd">
<bean id="postpaidTC1" class="com.tecnotree.CLM.beans.RegistrationBean">
<property name="service" value="GSM SERVICE" />
<property name="subService" value="Voice"/>
<property name="technology" value="gsm"/>
<property name="plan" value="POSTPAID ADV REN"/>
<property name="mCategory" value="POSTPAID NORMAL 2"/>
<property name="mSelection" value="Automatic"/>
<property name="firstName" value="Sarada"/>
<property name="middleName" value="M" />
<property name="lastName" value="Akurathi"/>
<property name ="dob" value="19/02/1989"/>
<property name ="prefLang" value="ENGLISH"/>
<property name ="prefMedium" value="Email"/>
<property name ="prefMediumValue" value="[email protected]"/>
<property name ="streetName" value="Gandhi Nagar"/>
<property name ="buildingNumber" value="12"/>
<property name ="docPurpose" value="Proof Identity"/>
<property name ="docType" value="PANCARD"/>
<property name ="docId" value="VETY3D343"/>
<property name ="docPlaceOfIssue" value="Chennai"/>
<property name ="billCycle" value="5th TO 4th MONTHLY BILL CYCLE"/>
</bean>
<bean id="postpaidTC2" class="com.tecnotree.CLM.beans.RegistrationBean">
<property name="firstName" value="Suneetha"/>
<property name="lastName" value="ss"/>
<property name ="dob" value="19/02/1989"/>
<property name ="prefLang" value="ENGLISH"/>
<property name ="prefMedium" value="Email"/>
<property name ="prefMediumValue" value="[email protected]"/>
<property name="plan" value="POSTPAID ADV REN"/>
</bean>
</beans>
を反復処理でき??? –
Seleniumスクリプトでは、xmlにテストデータプロバイダとしてBeanを使用しています。 –
これはセレンの問題ではないので、この質問からセレンのタグを削除してください –