I am using Java to modify Selenium RC test cases.
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;
public class TestCase extends SeleneseTestCase {
@Test
public void testLogin() throws Exception {
selenium.windowMaximize();
selenium.open("/en/QuoteGenerator.aspx");
selenium.waitForPageToLoad("30000");
int r = selenium.getXpathCount("//table[@id='tblDetail']/tbody/tr[.]/td[1]");
r = r - 2;
}
Eclipse is highlighting this part (selenium.getXpathCount("//table[@id='tblDetail']/tbody/tr[.]/td[1]");
) and telling me the following error: "Type mismatch: cannot convert from Number to int".
I've tried using float, long, short, but all were in vain. How do I assign this number to a variable in this c开发者_Python百科ase. Could you please help?
Number result = selenium.getXpathCount("//table[@id='tblDetail']/tbody/tr[.]/td[1]");
int r = result.intValue();
精彩评论